Class: Tapioca::Compilers::Dsl::Protobuf::TypeMember
- Inherits:
-
Parlour::RbiGenerator::RbiObject
- Object
- Parlour::RbiGenerator::RbiObject
- Tapioca::Compilers::Dsl::Protobuf::TypeMember
- Extended by:
- T::Sig
- Defined in:
- lib/tapioca/compilers/dsl/protobuf.rb
Overview
Parlour doesn’t support type members out of the box, so adding the ability to do that here. This should be upstreamed.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #describe ⇒ Object
- #generate_rbi(indent_level, options) ⇒ Object
- #merge_into_self(others) ⇒ Object
- #mergeable?(others) ⇒ Boolean
Instance Method Details
#==(other) ⇒ Object
71 72 73 |
# File 'lib/tapioca/compilers/dsl/protobuf.rb', line 71 def ==(other) TypeMember === other && name == other.name end |
#describe ⇒ Object
97 98 99 |
# File 'lib/tapioca/compilers/dsl/protobuf.rb', line 97 def describe "Type Member (#{name})" end |
#generate_rbi(indent_level, options) ⇒ Object
80 81 82 |
# File 'lib/tapioca/compilers/dsl/protobuf.rb', line 80 def generate_rbi(indent_level, ) [.indented(indent_level, "#{name} = type_member")] end |
#merge_into_self(others) ⇒ Object
94 |
# File 'lib/tapioca/compilers/dsl/protobuf.rb', line 94 def merge_into_self(others); end |
#mergeable?(others) ⇒ Boolean
89 90 91 |
# File 'lib/tapioca/compilers/dsl/protobuf.rb', line 89 def mergeable?(others) others.all? { |other| self == other } end |