Class: RabbitFeed::Client

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/rabbit_feed/client.rb

Constant Summary collapse

DEFAULTS =
{
  payload:      'test',
  require_path: '.',
  config_file:  'config/rabbit_feed.yml',
  logfile:      'log/rabbit_feed.log',
  pidfile:      'tmp/pids/rabbit_feed.pid'
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arguments = ARGV) ⇒ Client

Returns a new instance of Client.



26
27
28
29
30
31
32
33
34
# File 'lib/rabbit_feed/client.rb', line 26

def initialize(arguments = ARGV)
  @command = arguments[0]
  @options = parse_options arguments
  return if shutdown?
  validate!
  set_logging
  set_configuration
  load_dependancies unless console?
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



17
18
19
# File 'lib/rabbit_feed/client.rb', line 17

def command
  @command
end

#optionsObject (readonly)

Returns the value of attribute options.



17
18
19
# File 'lib/rabbit_feed/client.rb', line 17

def options
  @options
end

Instance Method Details

#runObject



36
37
38
# File 'lib/rabbit_feed/client.rb', line 36

def run
  send(command)
end