In Files

  • rbs-1.0.4/lib/rbs/definition_builder/method_builder.rb

Class/Module Index [+]

Quicksearch

RBS::DefinitionBuilder::MethodBuilder::Methods

Constants

Definition

Attributes

methods[R]
type[R]

Public Class Methods

new(type:) click to toggle source
 
               # File rbs-1.0.4/lib/rbs/definition_builder/method_builder.rb, line 22
def initialize(type))
  @type = type
  @methods = {}
end
            

Public Instance Methods

each() click to toggle source
 
               # File rbs-1.0.4/lib/rbs/definition_builder/method_builder.rb, line 41
def each
  if block_given?
    Sorter.new(methods).each_strongly_connected_component do |scc|
      if scc.size > 1
        raise RecursiveAliasDefinitionError.new(type: type, defs: scc)
      end

      yield scc[0]
    end
  else
    enum_for :each
  end
end
            
validate!() click to toggle source
 
               # File rbs-1.0.4/lib/rbs/definition_builder/method_builder.rb, line 27
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