Module: Dripper::ClassMethods

Defined in:
lib/dripper.rb

Instance Method Summary collapse

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_blocksObject



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(options={})
  # nothing here
end

#perform(options = {}) ⇒ Object



71
72
73
74
75
76
# File 'lib/dripper.rb', line 71

def perform(options={})
  position = options.delete(:position)
  if found = after_blocks[position]
    found[:block].call(fetch_instance(options))
  end
end

#send_at(offset_array, options = {}) ⇒ Object



66
67
68
69
# File 'lib/dripper.rb', line 66

def send_at(offset_array, options={})
  @send_at_offset = offset_array
  @send_at_options = { :weekends => true }.merge(options)
end

#send_at_offsetObject



55
# File 'lib/dripper.rb', line 55

def send_at_offset ; @send_at_offset ; end

#send_at_optionsObject



56
# File 'lib/dripper.rb', line 56

def send_at_options ; @send_at_options || { :weekends => true } ; end