Class: Fetch::Module
- Inherits:
-
Object
- Object
- Fetch::Module
- Defined in:
- lib/fetch/module.rb
Instance Method Summary collapse
-
#fetch? ⇒ Boolean
Whether or not the module should be used when fetching.
-
#initialize(fetchable = nil) ⇒ Module
constructor
A new instance of Module.
Methods included from Async
Methods included from Callbacks
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`.
16 17 18 19 |
# File 'lib/fetch/module.rb', line 16 def fetch? return true unless callback?(:fetch_if) !!fetch_if end |