Module: DhEasy::Core::Plugin::Seeder

Includes:
InitializeHook, SeederBehavior
Defined in:
lib/dh_easy/core/plugin/seeder.rb

Instance Attribute Summary collapse

Attributes included from ContextIntegrator

#context

Instance Method Summary collapse

Methods included from ExecutorBehavior

#enqueue, #save

Methods included from ContextIntegrator

#initialize_hook_core_context_integrator, #mock_context

Methods included from InitializeHook

#initialize_hooks

Instance Attribute Details

Cookie to use on page seeing.

Returns:

  • (String)


18
19
20
# File 'lib/dh_easy/core/plugin/seeder.rb', line 18

def cookie
  @cookie
end

#refererString

Referer to use on page seeding.

Returns:

  • (String)


14
15
16
# File 'lib/dh_easy/core/plugin/seeder.rb', line 14

def referer
  @referer
end

#root_input_dirString

Root input directory path.

Returns:

  • (String)


10
11
12
# File 'lib/dh_easy/core/plugin/seeder.rb', line 10

def root_input_dir
  @root_input_dir
end

Instance Method Details

#initialize(opts = {}) ⇒ Object

Initialize seeder and hooks.

Parameters:

  • opts (Hash) (defaults to: {})

    ({}) Configuration options.

See Also:



38
39
40
# File 'lib/dh_easy/core/plugin/seeder.rb', line 38

def initialize opts = {}
  initialize_hooks opts
end

#initialize_hook_core_seeder(opts = {}) ⇒ Object

Hook to initialize seeder object.

Parameters:

  • opts (Hash) (defaults to: {})

    ({}) Configuration options.

Options Hash (opts):

  • :root_input_dir (String) — default: nil

    Root directory for inputs.

  • :referer (String) — default: nil

    New pages referer, useful to dynamic setups.

  • :cookie (String) — default: nil

    Cookie to use on seeded pages fetchs.



26
27
28
29
30
# File 'lib/dh_easy/core/plugin/seeder.rb', line 26

def initialize_hook_core_seeder opts = {}
  @root_input_dir = opts[:root_input_dir]
  @referer = opts[:referer]
  @cookie = opts[:cookie]
end