Class: RBS::Types::Bases::Base
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
|
|
Super Chains via Extension / Inclusion / Inheritance | |
Instance Chain:
|
|
Inherits: | Object |
Defined in: | lib/rbs/types.rb |
Class Method Summary
- .new(location:) ⇒ Base constructor
Instance Attribute Summary
- #location readonly
Instance Method Summary
- #==(other) (also: #eql?)
-
#eql?(other)
::RBS::Types::Alias
for #==. - #hash
- #to_json(state = _ = nil)
- #to_s(level = 0)
::RBS::Types::NoTypeName
- Included
::RBS::Types::EmptyEachType
- Included
::RBS::Types::NoSubst
- Included
::RBS::Types::NoFreeVariables
- Included
Constructor Details
.new(location:) ⇒ Base
# File 'lib/rbs/types.rb', line 45
def initialize(location:) @location = location end
Instance Attribute Details
#location (readonly)
[ GitHub ]# File 'lib/rbs/types.rb', line 43
attr_reader :location
Instance Method Details
#==(other) Also known as: #eql?
[ GitHub ]# File 'lib/rbs/types.rb', line 49
def ==(other) other.is_a?(self.class) end
#eql?(other)
::RBS::Types::Alias
for #==.
# File 'lib/rbs/types.rb', line 57
alias eql? ==
#hash
[ GitHub ]# File 'lib/rbs/types.rb', line 53
def hash self.class.hash end
#to_json(state = _ = nil)
[ GitHub ]#to_s(level = 0)
[ GitHub ]# File 'lib/rbs/types.rb', line 69
def to_s(level = 0) case self when Types::Bases::Bool 'bool' when Types::Bases::Void 'void' when Types::Bases::Any 'untyped' when Types::Bases::Nil 'nil' when Types::Bases::Top 'top' when Types::Bases::Bottom 'bot' when Types::Bases::Self 'self' when Types::Bases::Instance 'instance' when Types::Bases::Class 'class' else raise "Unexpected base type: #{inspect}" end end