Class: RBS::DefinitionBuilder::OneAncestors
- Inherits:
-
Object
- Object
- RBS::DefinitionBuilder::OneAncestors
- Defined in:
- lib/rbs/definition_builder.rb
Instance Attribute Summary collapse
-
#extended_modules ⇒ Object
readonly
Returns the value of attribute extended_modules.
-
#included_modules ⇒ Object
readonly
Returns the value of attribute included_modules.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#prepended_modules ⇒ Object
readonly
Returns the value of attribute prepended_modules.
-
#self_types ⇒ Object
readonly
Returns the value of attribute self_types.
-
#super_class ⇒ Object
readonly
Returns the value of attribute super_class.
-
#type_name ⇒ Object
readonly
Returns the value of attribute type_name.
Class Method Summary collapse
- .class_instance(type_name:, params:, super_class:) ⇒ Object
- .module_instance(type_name:, params:) ⇒ Object
- .singleton(type_name:, super_class:) ⇒ Object
Instance Method Summary collapse
- #each_ancestor(&block) ⇒ Object
-
#initialize(type_name:, params:, super_class:, self_types:, included_modules:, prepended_modules:, extended_modules:) ⇒ OneAncestors
constructor
A new instance of OneAncestors.
Constructor Details
#initialize(type_name:, params:, super_class:, self_types:, included_modules:, prepended_modules:, extended_modules:) ⇒ OneAncestors
Returns a new instance of OneAncestors.
28 29 30 31 32 33 34 35 36 |
# File 'lib/rbs/definition_builder.rb', line 28 def initialize(type_name:, params:, super_class:, self_types:, included_modules:, prepended_modules:, extended_modules:) @type_name = type_name @params = params @super_class = super_class @self_types = self_types @included_modules = included_modules @prepended_modules = prepended_modules @extended_modules = extended_modules end |
Instance Attribute Details
#extended_modules ⇒ Object (readonly)
Returns the value of attribute extended_modules.
26 27 28 |
# File 'lib/rbs/definition_builder.rb', line 26 def extended_modules @extended_modules end |
#included_modules ⇒ Object (readonly)
Returns the value of attribute included_modules.
24 25 26 |
# File 'lib/rbs/definition_builder.rb', line 24 def included_modules @included_modules end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
21 22 23 |
# File 'lib/rbs/definition_builder.rb', line 21 def params @params end |
#prepended_modules ⇒ Object (readonly)
Returns the value of attribute prepended_modules.
25 26 27 |
# File 'lib/rbs/definition_builder.rb', line 25 def prepended_modules @prepended_modules end |
#self_types ⇒ Object (readonly)
Returns the value of attribute self_types.
23 24 25 |
# File 'lib/rbs/definition_builder.rb', line 23 def self_types @self_types end |
#super_class ⇒ Object (readonly)
Returns the value of attribute super_class.
22 23 24 |
# File 'lib/rbs/definition_builder.rb', line 22 def super_class @super_class end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
20 21 22 |
# File 'lib/rbs/definition_builder.rb', line 20 def type_name @type_name end |
Class Method Details
.class_instance(type_name:, params:, super_class:) ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/rbs/definition_builder.rb', line 53 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: [], prepended_modules: [], extended_modules: nil ) end |
.module_instance(type_name:, params:) ⇒ Object
77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/rbs/definition_builder.rb', line 77 def self.module_instance(type_name:, params:) new( type_name: type_name, params: params, self_types: [], included_modules: [], prepended_modules: [], super_class: nil, extended_modules: nil ) end |
.singleton(type_name:, super_class:) ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/rbs/definition_builder.rb', line 65 def self.singleton(type_name:, super_class:) new( type_name: type_name, params: nil, super_class: super_class, self_types: nil, included_modules: nil, prepended_modules: nil, extended_modules: [] ) end |
Instance Method Details
#each_ancestor(&block) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/rbs/definition_builder.rb', line 38 def each_ancestor(&block) if block if s = super_class yield s end self_types&.each(&block) included_modules&.each(&block) prepended_modules&.each(&block) extended_modules&.each(&block) else enum_for :each_ancestor end end |