Class: Textus::Manifest::Entry::Intake
- Inherits:
-
Base
- Object
- Textus::Manifest::Entry
- Base
- Textus::Manifest::Entry::Intake
- Defined in:
- lib/textus/manifest/entry/intake.rb
Constant Summary collapse
- KIND =
:intake
Constants inherited from Textus::Manifest::Entry
PUBLISH_EACH_VARS, PUBLISH_EACH_VAR_RE, REGISTRY
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#events ⇒ Object
readonly
Returns the value of attribute events.
-
#handler ⇒ Object
readonly
Returns the value of attribute handler.
Attributes inherited from Base
#format, #key, #manifest, #owner, #path, #publish_to, #raw, #schema, #zone
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(handler:, config: {}, events: {}, **rest) ⇒ Intake
constructor
A new instance of Intake.
- #intake? ⇒ Boolean
- #nested? ⇒ Boolean
Methods inherited from Base
#derived?, #in_generator_zone?, #in_proposal_zone?, #index_filename, #inject_boot, #leaf?, #publish_each, #publish_via, #template, #zone_writers
Constructor Details
#initialize(handler:, config: {}, events: {}, **rest) ⇒ Intake
Returns a new instance of Intake.
7 8 9 10 11 12 |
# File 'lib/textus/manifest/entry/intake.rb', line 7 def initialize(handler:, config: {}, events: {}, **rest) super(**rest) @handler = handler @config = config || {} @events = events || {} end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
5 6 7 |
# File 'lib/textus/manifest/entry/intake.rb', line 5 def config @config end |
#events ⇒ Object (readonly)
Returns the value of attribute events.
5 6 7 |
# File 'lib/textus/manifest/entry/intake.rb', line 5 def events @events end |
#handler ⇒ Object (readonly)
Returns the value of attribute handler.
5 6 7 |
# File 'lib/textus/manifest/entry/intake.rb', line 5 def handler @handler end |
Class Method Details
.from_raw(common, raw) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/textus/manifest/entry/intake.rb', line 19 def self.from_raw(common, raw) intake = raw["intake"] || {} handler = intake["handler"] || raw["intake_handler"] or raise UsageError.new("intake entry '#{common[:key]}' missing handler") config = intake["config"] || raw["intake_config"] || {} new(handler: handler, config: config, events: raw["events"] || {}, **common) end |
Instance Method Details
#intake? ⇒ Boolean
14 |
# File 'lib/textus/manifest/entry/intake.rb', line 14 def intake? = true |
#nested? ⇒ Boolean
15 |
# File 'lib/textus/manifest/entry/intake.rb', line 15 def nested? = !!@raw["nested"] |