Class: RBS::DefinitionBuilder::MethodBuilder::Methods
Relationships & Source Files | |
Namespace Children | |
Classes:
| |
Inherits: | Object |
Defined in: | lib/rbs/definition_builder/method_builder.rb |
Constant Summary
-
Definition =
# File 'lib/rbs/definition_builder/method_builder.rb', line 5_ = Struct.new(:name, :type, :originals, :overloads, :accessibilities, keyword_init: true) do # @implements Definition def original originals.first end def accessibility accessibilities[0] end def self.empty(name:, type:) new(type: type, name: name, originals: [], overloads: [], accessibilities: []) end end
Class Method Summary
- .new(type:) ⇒ Methods constructor
Instance Attribute Summary
Instance Method Summary
Constructor Details
.new(type:) ⇒ Methods
# File 'lib/rbs/definition_builder/method_builder.rb', line 24
def initialize(type:) @type = type @methods = {} end
Instance Attribute Details
#methods (readonly)
[ GitHub ]# File 'lib/rbs/definition_builder/method_builder.rb', line 22
attr_reader :methods
#type (readonly)
[ GitHub ]# File 'lib/rbs/definition_builder/method_builder.rb', line 21
attr_reader :type
Instance Method Details
#each
[ GitHub ]#validate!
[ GitHub ]# File 'lib/rbs/definition_builder/method_builder.rb', line 29
def validate! methods.each_value do |defn| if defn.originals.size > 1 raise DuplicatedMethodDefinitionError.new( type: type, method_name: defn.name, members: defn.originals ) end end self end