Class: Fetch::Module

Inherits:
Object
  • Object
show all
Includes:
Async, Callbacks
Defined in:
lib/fetch/module.rb

Instance Method Summary collapse

Methods included from Async

included, #requests

Methods included from Callbacks

included

Constructor Details

#initialize(fetchable = nil) ⇒ Module

Returns a new instance of Module.



10
11
12
# File 'lib/fetch/module.rb', line 10

def initialize(fetchable = nil)
  @fetchable = fetchable
end

Instance Method Details

#fetch?Boolean

Whether or not the module should be used when fetching. Set with ‘fetch_if do … end`.

Returns:

  • (Boolean)


16
17
18
19
# File 'lib/fetch/module.rb', line 16

def fetch?
  return true unless callback?(:fetch_if)
  !!fetch_if
end