Module: AeEasy::Core::Plugin::ParserBehavior

Includes:
ContextIntegrator
Included in:
Parser
Defined in:
lib/ae_easy/core/plugin/parser_behavior.rb

Instance Attribute Summary

Attributes included from ContextIntegrator

#context

Instance Method Summary collapse

Methods included from ContextIntegrator

#initialize_hook_core_context_integrator, #mock_context

Instance Method Details

#enqueue(pages) ⇒ Object

Note:

Instance must implement:

  • `save_pages(pages)`

Enqueue a single/multiple pages for fetch. Analog to `save_pages`.

Parameters:

  • pages (Array, Hash)

    Pages to save being Hash when single and Array when many.



13
14
15
16
# File 'lib/ae_easy/core/plugin/parser_behavior.rb', line 13

def enqueue pages
  pages = [pages] unless pages.is_a? Array
  save_pages pages
end

#save(outputs) ⇒ Object

Note:

Instance must implement:

  • `save_outputs(outputs)`

Save a single/multiple outputs. Analog to `save_outputs`.

Parameters:

  • outputs (Array, Hash)

    Outputs to save being Hash when single and Array when many.



24
25
26
27
# File 'lib/ae_easy/core/plugin/parser_behavior.rb', line 24

def save outputs
  outputs = [outputs] unless outputs.is_a? Array
  save_outputs outputs
end

#varsObject

Note:

Instance must implement:

  • `page`

Alias to `page`.



33
34
35
# File 'lib/ae_easy/core/plugin/parser_behavior.rb', line 33

def vars
  page['vars']
end