Class: Tapioca::Compilers::Dsl::Protobuf::TypeMember

Inherits:
Parlour::RbiGenerator::RbiObject
  • Object
show all
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

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

#describeObject



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, options)
  [options.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

Returns:

  • (Boolean)


89
90
91
# File 'lib/tapioca/compilers/dsl/protobuf.rb', line 89

def mergeable?(others)
  others.all? { |other| self == other }
end