Class: Textus::Manifest::Entry::Intake

Inherits:
Base show all
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

Attributes inherited from Base

#format, #key, #manifest, #owner, #path, #publish_to, #raw, #schema, #zone

Class Method Summary collapse

Instance Method Summary collapse

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

#configObject (readonly)

Returns the value of attribute config.



5
6
7
# File 'lib/textus/manifest/entry/intake.rb', line 5

def config
  @config
end

#eventsObject (readonly)

Returns the value of attribute events.



5
6
7
# File 'lib/textus/manifest/entry/intake.rb', line 5

def events
  @events
end

#handlerObject (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

Returns:

  • (Boolean)


14
# File 'lib/textus/manifest/entry/intake.rb', line 14

def intake?  = true

#nested?Boolean

Returns:

  • (Boolean)


15
# File 'lib/textus/manifest/entry/intake.rb', line 15

def nested?  = !!@raw["nested"]