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
- #has_classish_type? ⇒ Boolean readonly
- #has_self_type? ⇒ Boolean readonly
- #location readonly
- #name readonly
- #with_nonreturn_void? ⇒ Boolean readonly
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 176
def self.fresh(v = :T) @@count = @@count + 1 new(name: :"#{v}@#{@@count}", location: nil) end
Instance Attribute Details
#has_classish_type? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/rbs/types.rb', line 191
def has_classish_type? false end
#has_self_type? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/rbs/types.rb', line 187
def has_self_type? false end
#location (readonly)
[ GitHub ]# File 'lib/rbs/types.rb', line 133
attr_reader :location
#name (readonly)
[ GitHub ]# File 'lib/rbs/types.rb', line 132
attr_reader :name
#with_nonreturn_void? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/rbs/types.rb', line 195
def with_nonreturn_void? false end
Instance Method Details
#==(other) Also known as: #eql?
[ GitHub ]#eql?(other)
[ GitHub ]# File 'lib/rbs/types.rb', line 146
alias eql? ==
#free_variables(set = Set.new)
[ GitHub ]#hash
[ GitHub ]# File 'lib/rbs/types.rb', line 148
def hash self.class.hash ^ name.hash end
#sub(s)
[ GitHub ]# File 'lib/rbs/types.rb', line 162
def sub(s) s.apply(self) end
#to_json(state = _ = nil)
[ GitHub ]#to_s(level = 0)
[ GitHub ]# File 'lib/rbs/types.rb', line 181
def to_s(level = 0) name.to_s end