Class: RBS::Types::Bases::Base
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from NoTypeName
#map_type_name
#each_type, #map_type
Methods included from NoSubst
#sub
#free_variables
Constructor Details
#initialize(location:) ⇒ Base
Returns a new instance of Base.
45
46
47
|
# File 'lib/rbs/types.rb', line 45
def initialize(location:)
@location = location
end
|
Instance Attribute Details
#location ⇒ Object
Returns the value of attribute location.
43
44
45
|
# File 'lib/rbs/types.rb', line 43
def location
@location
end
|
Instance Method Details
#==(other) ⇒ Object
Also known as:
eql?
49
50
51
|
# File 'lib/rbs/types.rb', line 49
def ==(other)
other.is_a?(self.class)
end
|
#has_classish_type? ⇒ Boolean
98
99
100
|
# File 'lib/rbs/types.rb', line 98
def has_classish_type?
self.is_a?(Bases::Instance) || self.is_a?(Bases::Class)
end
|
#has_self_type? ⇒ Boolean
94
95
96
|
# File 'lib/rbs/types.rb', line 94
def has_self_type?
self.is_a?(Types::Bases::Self)
end
|
#hash ⇒ Object
53
54
55
|
# File 'lib/rbs/types.rb', line 53
def hash
self.class.hash
end
|
#to_json(state = _ = nil) ⇒ Object
64
65
66
67
|
# File 'lib/rbs/types.rb', line 64
def to_json(state = _ = nil)
klass = to_s.to_sym
{ class: klass, location: location }.to_json(state)
end
|
#to_s(level = 0) ⇒ Object
#with_nonreturn_void? ⇒ Boolean
102
103
104
|
# File 'lib/rbs/types.rb', line 102
def with_nonreturn_void?
self.is_a?(Bases::Void)
end
|