class RBS::DefinitionBuilder::AncestorBuilder::OneAncestors

Attributes

extended_interfaces[R]
extended_modules[R]
included_interfaces[R]
included_modules[R]
params[R]
prepended_modules[R]
self_types[R]
super_class[R]
type_name[R]

Public Class Methods

class_instance(type_name:, params:, super_class:) click to toggle source
# File rbs-2.7.0/lib/rbs/definition_builder/ancestor_builder.rb, line 94
def self.class_instance(type_name:, params:, super_class:)
  new(
    type_name: type_name,
    params: params,
    super_class: super_class,
    self_types: nil,
    included_modules: [],
    included_interfaces: [],
    prepended_modules: [],
    extended_modules: nil,
    extended_interfaces: nil
  )
end
interface(type_name:, params:) click to toggle source
# File rbs-2.7.0/lib/rbs/definition_builder/ancestor_builder.rb, line 136
def self.interface(type_name:, params:)
  new(
    type_name: type_name,
    params: params,
    self_types: nil,
    included_modules: nil,
    included_interfaces: [],
    prepended_modules: nil,
    super_class: nil,
    extended_modules: nil,
    extended_interfaces: nil
  )
end
module_instance(type_name:, params:) click to toggle source
# File rbs-2.7.0/lib/rbs/definition_builder/ancestor_builder.rb, line 122
def self.module_instance(type_name:, params:)
  new(
    type_name: type_name,
    params: params,
    self_types: [],
    included_modules: [],
    included_interfaces: [],
    prepended_modules: [],
    super_class: nil,
    extended_modules: nil,
    extended_interfaces: nil
  )
end
new(type_name:, params:, super_class:, self_types:, included_modules:, included_interfaces:, prepended_modules:, extended_modules:, extended_interfaces:) click to toggle source
# File rbs-2.7.0/lib/rbs/definition_builder/ancestor_builder.rb, line 17
def initialize(type_name:, params:, super_class:, self_types:, included_modules:, included_interfaces:, prepended_modules:, extended_modules:, extended_interfaces:)
  @type_name = type_name
  @params = params
  @super_class = super_class
  @self_types = self_types
  @included_modules = included_modules
  @included_interfaces = included_interfaces
  @prepended_modules = prepended_modules
  @extended_modules = extended_modules
  @extended_interfaces = extended_interfaces
end
singleton(type_name:, super_class:) click to toggle source
# File rbs-2.7.0/lib/rbs/definition_builder/ancestor_builder.rb, line 108
def self.singleton(type_name:, super_class:)
  new(
    type_name: type_name,
    params: nil,
    super_class: super_class,
    self_types: nil,
    included_modules: nil,
    included_interfaces: nil,
    prepended_modules: nil,
    extended_modules: [],
    extended_interfaces: []
  )
end

Public Instance Methods

each_ancestor() { |s| ... } click to toggle source
# File rbs-2.7.0/lib/rbs/definition_builder/ancestor_builder.rb, line 29
def each_ancestor(&block)
  if block
    if s = super_class
      yield s
    end

    each_self_type(&block)
    each_included_module(&block)
    each_included_interface(&block)
    each_prepended_module(&block)
    each_extended_module(&block)
    each_extended_interface(&block)
  else
    enum_for :each_ancestor
  end
end
each_extended_interface(&block) click to toggle source
# File rbs-2.7.0/lib/rbs/definition_builder/ancestor_builder.rb, line 86
def each_extended_interface(&block)
  if block
    extended_interfaces&.each(&block)
  else
    enum_for :each_extended_interface
  end
end
each_extended_module(&block) click to toggle source
# File rbs-2.7.0/lib/rbs/definition_builder/ancestor_builder.rb, line 78
def each_extended_module(&block)
  if block
    extended_modules&.each(&block)
  else
    enum_for :each_extended_module
  end
end
each_included_interface(&block) click to toggle source
# File rbs-2.7.0/lib/rbs/definition_builder/ancestor_builder.rb, line 62
def each_included_interface(&block)
  if block
    included_interfaces&.each(&block)
  else
    enum_for :each_included_interface
  end
end
each_included_module(&block) click to toggle source
# File rbs-2.7.0/lib/rbs/definition_builder/ancestor_builder.rb, line 54
def each_included_module(&block)
  if block
    included_modules&.each(&block)
  else
    enum_for :each_included_module
  end
end
each_prepended_module(&block) click to toggle source
# File rbs-2.7.0/lib/rbs/definition_builder/ancestor_builder.rb, line 70
def each_prepended_module(&block)
  if block
    prepended_modules&.each(&block)
  else
    enum_for :each_prepended_module
  end
end
each_self_type(&block) click to toggle source
# File rbs-2.7.0/lib/rbs/definition_builder/ancestor_builder.rb, line 46
def each_self_type(&block)
  if block
    self_types&.each(&block)
  else
    enum_for :each_self_type
  end
end