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.1.0/lib/rbs/definition_builder/ancestor_builder.rb, line 92
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.1.0/lib/rbs/definition_builder/ancestor_builder.rb, line 134
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.1.0/lib/rbs/definition_builder/ancestor_builder.rb, line 120
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.1.0/lib/rbs/definition_builder/ancestor_builder.rb, line 15
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.1.0/lib/rbs/definition_builder/ancestor_builder.rb, line 106
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.1.0/lib/rbs/definition_builder/ancestor_builder.rb, line 27
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.1.0/lib/rbs/definition_builder/ancestor_builder.rb, line 84
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.1.0/lib/rbs/definition_builder/ancestor_builder.rb, line 76
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.1.0/lib/rbs/definition_builder/ancestor_builder.rb, line 60
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.1.0/lib/rbs/definition_builder/ancestor_builder.rb, line 52
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.1.0/lib/rbs/definition_builder/ancestor_builder.rb, line 68
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.1.0/lib/rbs/definition_builder/ancestor_builder.rb, line 44
def each_self_type(&block)
  if block
    self_types&.each(&block)
  else
    enum_for :each_self_type
  end
end