Class: Cumuliform::Section Private
- Inherits:
-
Object
- Object
- Cumuliform::Section
- Defined in:
- lib/cumuliform/section.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #imports ⇒ Object readonly private
- #items ⇒ Object readonly private
- #name ⇒ Object readonly private
Instance Method Summary collapse
- #[](name) ⇒ Object private
- #[]=(name, item) ⇒ Object private
- #each(&block) ⇒ Object private
- #empty? ⇒ Boolean private
-
#initialize(name, imports) ⇒ Section
constructor
private
A new instance of Section.
- #member?(name) ⇒ Boolean private
- #merged ⇒ Object private
Constructor Details
#initialize(name, imports) ⇒ Section
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Section.
6 7 8 9 10 |
# File 'lib/cumuliform/section.rb', line 6 def initialize(name, imports) @name = name @imports = imports @items = {} end |
Instance Attribute Details
#imports ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
4 5 6 |
# File 'lib/cumuliform/section.rb', line 4 def imports @imports end |
#items ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
4 5 6 |
# File 'lib/cumuliform/section.rb', line 4 def items @items end |
#name ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
4 5 6 |
# File 'lib/cumuliform/section.rb', line 4 def name @name end |
Instance Method Details
#[](name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 |
# File 'lib/cumuliform/section.rb', line 16 def [](name) merged[name] end |
#[]=(name, item) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 |
# File 'lib/cumuliform/section.rb', line 12 def []=(name, item) items[name] = item end |
#each(&block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
20 21 22 |
# File 'lib/cumuliform/section.rb', line 20 def each(&block) merged.each(&block) end |
#empty? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
28 29 30 |
# File 'lib/cumuliform/section.rb', line 28 def empty? merged.empty? end |
#member?(name) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 |
# File 'lib/cumuliform/section.rb', line 24 def member?(name) merged.member?(name) end |
#merged ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
32 33 34 35 36 |
# File 'lib/cumuliform/section.rb', line 32 def merged imports.reduce({}) { |merged, import| import.get_section(name).merged.merge(merged) }.merge(items) end |