123456789_123456789_123456789_123456789_123456789_

Module: RBS::Types::Application

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/rbs/types.rb

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#args (readonly)

[ GitHub ]

  
# File 'lib/rbs/types.rb', line 200

attr_reader :args

#name (readonly)

[ GitHub ]

  
# File 'lib/rbs/types.rb', line 199

attr_reader :name

Instance Method Details

#==(other) Also known as: #eql?

[ GitHub ]

  
# File 'lib/rbs/types.rb', line 202

def ==(other)
  other.is_a?(self.class) && other.name == name && other.args == args
end

#each_type(&block)

[ GitHub ]

  
# File 'lib/rbs/types.rb', line 228

def each_type(&block)
  if block
    args.each(&block)
  else
    enum_for :each_type
  end
end

#eql?(other)

Alias for #==.

[ GitHub ]

  
# File 'lib/rbs/types.rb', line 206

alias eql? ==

#free_variables(set = Set.new)

[ GitHub ]

  
# File 'lib/rbs/types.rb', line 212

def free_variables(set = Set.new)
  set.tap do
    args.each do |arg|
      arg.free_variables(set)
    end
  end
end

#hash

[ GitHub ]

  
# File 'lib/rbs/types.rb', line 208

def hash
  self.class.hash ^ name.hash ^ args.hash
end

#to_s(level = 0)

[ GitHub ]

  
# File 'lib/rbs/types.rb', line 220

def to_s(level = 0)
  if args.empty?
    name.to_s
  else
    "#{name}[#{args.join(", ")}]"
  end
end