Class: Terret::Composition::Resolved
- Inherits:
-
Data
- Object
- Data
- Terret::Composition::Resolved
- Defined in:
- lib/terret/composition.rb
Instance Attribute Summary collapse
-
#home ⇒ Object
readonly
Returns the value of attribute home.
-
#plugins ⇒ Object
readonly
Returns the value of attribute plugins.
-
#profile ⇒ Object
readonly
Returns the value of attribute profile.
-
#requires ⇒ Object
readonly
Returns the value of attribute requires.
-
#rows ⇒ Object
readonly
Returns the value of attribute rows.
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Instance Method Summary collapse
-
#materialize(allow_config_ruby: false) ⇒ Object
Rows in the shape Hames::Loader#layer wants, tags evaluated.
- #row(id) ⇒ Object
Instance Attribute Details
#home ⇒ Object (readonly)
Returns the value of attribute home
95 96 97 |
# File 'lib/terret/composition.rb', line 95 def home @home end |
#plugins ⇒ Object (readonly)
Returns the value of attribute plugins
95 96 97 |
# File 'lib/terret/composition.rb', line 95 def plugins @plugins end |
#profile ⇒ Object (readonly)
Returns the value of attribute profile
95 96 97 |
# File 'lib/terret/composition.rb', line 95 def profile @profile end |
#requires ⇒ Object (readonly)
Returns the value of attribute requires
95 96 97 |
# File 'lib/terret/composition.rb', line 95 def requires @requires end |
#rows ⇒ Object (readonly)
Returns the value of attribute rows
95 96 97 |
# File 'lib/terret/composition.rb', line 95 def rows @rows end |
#settings ⇒ Object (readonly)
Returns the value of attribute settings
95 96 97 |
# File 'lib/terret/composition.rb', line 95 def settings @settings end |
Instance Method Details
#materialize(allow_config_ruby: false) ⇒ Object
Rows in the shape Hames::Loader#layer wants, tags evaluated. plugin
is still the class NAME: resolving the constant is boot's job, because
a row whose constant does not resolve is something doctor reports
rather than something a dump-config discovers halfway through.
100 101 102 103 104 105 106 107 108 |
# File 'lib/terret/composition.rb', line 100 def materialize(allow_config_ruby: false) values = Composition.materialize_settings(settings, allow_config_ruby: allow_config_ruby) rows.map do |r| { id: r.id, plugin: r.plugin, disabled: r.disabled, config: Composition.materialize(r.config, settings: values, allow_config_ruby: allow_config_ruby, where: "row #{r.id.inspect} (config from #{r.config_layer})") } end end |
#row(id) ⇒ Object
110 |
# File 'lib/terret/composition.rb', line 110 def row(id) = rows.find { |r| r.id == id.to_s } |