Module: StartHer::Subscriber::ClassMethods

Defined in:
lib/start_her/subscriber.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#subscriber_error_blockObject

Returns the value of attribute subscriber_error_block.



18
19
20
# File 'lib/start_her/subscriber.rb', line 18

def subscriber_error_block
  @subscriber_error_block
end

#subscriber_heartbeat_blockObject

Returns the value of attribute subscriber_heartbeat_block.



18
19
20
# File 'lib/start_her/subscriber.rb', line 18

def subscriber_heartbeat_block
  @subscriber_heartbeat_block
end

#subscriber_on_psubscribe_blockObject

Returns the value of attribute subscriber_on_psubscribe_block.



18
19
20
# File 'lib/start_her/subscriber.rb', line 18

def subscriber_on_psubscribe_block
  @subscriber_on_psubscribe_block
end

#subscriber_options_hashObject

Returns the value of attribute subscriber_options_hash.



18
19
20
# File 'lib/start_her/subscriber.rb', line 18

def subscriber_options_hash
  @subscriber_options_hash
end

Instance Method Details

#run!Object



21
22
23
# File 'lib/start_her/subscriber.rb', line 21

def run!
  new(subscriber_options_hash[:channels]).run!
end

#subscriber_error(&block) ⇒ Object



33
34
35
# File 'lib/start_her/subscriber.rb', line 33

def subscriber_error(&block)
  self.subscriber_error_block = block
end

#subscriber_heartbeat(&block) ⇒ Object



25
26
27
# File 'lib/start_her/subscriber.rb', line 25

def subscriber_heartbeat(&block)
  self.subscriber_heartbeat_block = block
end

#subscriber_on_psubscribe(&block) ⇒ Object



29
30
31
# File 'lib/start_her/subscriber.rb', line 29

def subscriber_on_psubscribe(&block)
  self.subscriber_on_psubscribe_block = block
end

#subscriber_options(opts = {}) ⇒ Object



37
38
39
# File 'lib/start_her/subscriber.rb', line 37

def subscriber_options(opts = {})
  self.subscriber_options_hash = DEFAULT_OPTS.merge(opts)
end