class RBS::DefinitionBuilder::MethodBuilder::Methods

属性

methods[R]
type[R]

公共类方法

new(type:) 点击切换源代码
# File rbs-3.8.0/lib/rbs/definition_builder/method_builder.rb, line 30
def initialize(type:)
  @type = type
  @methods = {}
end

公共实例方法

each() { |scc| ... } 点击切换源代码
# File rbs-3.8.0/lib/rbs/definition_builder/method_builder.rb, line 49
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!() 点击切换源代码
# File rbs-3.8.0/lib/rbs/definition_builder/method_builder.rb, line 35
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