Class: RBSProtobuf::Name::Alias
- Inherits:
-
Object
- Object
- RBSProtobuf::Name::Alias
- Defined in:
- lib/rbs_protobuf/name.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #[](*args) ⇒ Object
-
#initialize(name) ⇒ Alias
constructor
A new instance of Alias.
- #type?(t) ⇒ Boolean
Constructor Details
#initialize(name) ⇒ Alias
Returns a new instance of Alias.
37 38 39 40 |
# File 'lib/rbs_protobuf/name.rb', line 37 def initialize(name) raise unless name.alias? @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
35 36 37 |
# File 'lib/rbs_protobuf/name.rb', line 35 def name @name end |
Instance Method Details
#[](*args) ⇒ Object
42 43 44 |
# File 'lib/rbs_protobuf/name.rb', line 42 def [](*args) RBS::Types::Alias.new(name: name, args: args, location: nil) end |
#type?(t) ⇒ Boolean
46 47 48 |
# File 'lib/rbs_protobuf/name.rb', line 46 def type?(t) t.is_a?(RBS::Types::Alias) && t.name == name end |