Class: RBS::Types::Variable
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Instance Chain:
self,
EmptyEachType ,
NoTypeName
|
|
Inherits: | Object |
Defined in: | lib/rbs/types.rb |
Class Method Summary
- .build(v)
- .fresh(v = :T)
- .new(name:, location:) ⇒ Variable constructor
Instance Attribute Summary
Instance Method Summary
- #==(other) (also: #eql?)
- #eql?(other)
- #free_variables(set = Set.new)
- #hash
- #sub(s)
- #to_json(state = _ = nil)
- #to_s(level = 0)
EmptyEachType
- Included
NoTypeName
- Included
Constructor Details
.new(name:, location:) ⇒ Variable
Class Method Details
.build(v)
[ GitHub ].fresh(v = :T)
[ GitHub ]# File 'lib/rbs/types.rb', line 155
def self.fresh(v = :T) @@count = @@count + 1 new(name: :"#{v}@#{@@count}", location: nil) end
Instance Attribute Details
#location (readonly)
[ GitHub ]# File 'lib/rbs/types.rb', line 112
attr_reader :location
#name (readonly)
[ GitHub ]# File 'lib/rbs/types.rb', line 111
attr_reader :name
Instance Method Details
#==(other) Also known as: #eql?
[ GitHub ]#eql?(other)
[ GitHub ]# File 'lib/rbs/types.rb', line 125
alias eql? ==
#free_variables(set = Set.new)
[ GitHub ]#hash
[ GitHub ]# File 'lib/rbs/types.rb', line 127
def hash self.class.hash ^ name.hash end
#sub(s)
[ GitHub ]# File 'lib/rbs/types.rb', line 141
def sub(s) s.apply(self) end
#to_json(state = _ = nil)
[ GitHub ]#to_s(level = 0)
[ GitHub ]# File 'lib/rbs/types.rb', line 160
def to_s(level = 0) name.to_s end