Module: Dripper::ClassMethods
- Defined in:
- lib/dripper.rb
Instance Method Summary collapse
- #after(offset, &block) ⇒ Object
- #after_blocks ⇒ Object
- #fetch_instance(options = {}) ⇒ Object
- #perform(options = {}) ⇒ Object
- #send_at(offset_array, options = {}) ⇒ Object
- #send_at_offset ⇒ Object
- #send_at_options ⇒ Object
Instance Method Details
#after(offset, &block) ⇒ Object
62 63 64 |
# File 'lib/dripper.rb', line 62 def after(offset, &block) after_blocks << { offset: offset, block: block } end |
#after_blocks ⇒ Object
58 59 60 |
# File 'lib/dripper.rb', line 58 def after_blocks @after_blocks ||= [] end |
#fetch_instance(options = {}) ⇒ Object
78 79 80 |
# File 'lib/dripper.rb', line 78 def fetch_instance(={}) # nothing here end |
#perform(options = {}) ⇒ Object
71 72 73 74 75 76 |
# File 'lib/dripper.rb', line 71 def perform(={}) position = .delete(:position) if found = after_blocks[position] found[:block].call(fetch_instance()) end end |
#send_at(offset_array, options = {}) ⇒ Object
66 67 68 69 |
# File 'lib/dripper.rb', line 66 def send_at(offset_array, ={}) @send_at_offset = offset_array @send_at_options = { :weekends => true }.merge() end |
#send_at_offset ⇒ Object
55 |
# File 'lib/dripper.rb', line 55 def send_at_offset ; @send_at_offset ; end |
#send_at_options ⇒ Object
56 |
# File 'lib/dripper.rb', line 56 def ; @send_at_options || { :weekends => true } ; end |