Class: RBSProtobuf::Name::Interface
- Inherits:
-
Object
- Object
- RBSProtobuf::Name::Interface
- 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) ⇒ Interface
constructor
A new instance of Interface.
- #type?(t) ⇒ Boolean
Constructor Details
#initialize(name) ⇒ Interface
Returns a new instance of Interface.
54 55 56 57 |
# File 'lib/rbs_protobuf/name.rb', line 54 def initialize(name) raise unless name.interface? @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
52 53 54 |
# File 'lib/rbs_protobuf/name.rb', line 52 def name @name end |
Instance Method Details
#[](*args) ⇒ Object
59 60 61 |
# File 'lib/rbs_protobuf/name.rb', line 59 def [](*args) RBS::Types::Interface.new(name: name, args: args, location: nil) end |
#type?(t) ⇒ Boolean
63 64 65 |
# File 'lib/rbs_protobuf/name.rb', line 63 def type?(t) t.is_a?(RBS::Types::Interface) && t.name == name end |