class RBS::DefinitionBuilder::MethodBuilder::Methods
Set of methods defined in a type.
Attributes
methods
[R]
Hash[Symbol, Definition]
type
[R]
instance_type
Public Class Methods
(type: instance_type) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/definition_builder/method_builder.rb, line 30 def initialize(type:) @type = type @methods = {} end
Public Instance Methods
() { (Definition) → void } → void
() → Enumerator[Definition, void]
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/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
() → self
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/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