Class: Envoi::Mam::Agent::BaseDaemon
- Inherits:
-
Object
- Object
- Envoi::Mam::Agent::BaseDaemon
- Defined in:
- lib/envoi/mam/agent/base_daemon.rb
Instance Attribute Summary collapse
-
#initial_args ⇒ Object
Returns the value of attribute initial_args.
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize(*args) ⇒ BaseDaemon
constructor
A new instance of BaseDaemon.
-
#set_instance_variables(args = nil) ⇒ Object
Processes a hash and creates instance variables for each key set to it’s corresponding value If args is an array then it processes the first hash it comes to in that array (Good for passing *args from a previous method).
Constructor Details
#initialize(*args) ⇒ BaseDaemon
Returns a new instance of BaseDaemon.
9 10 11 |
# File 'lib/envoi/mam/agent/base_daemon.rb', line 9 def initialize(*args) @initial_args = args end |
Instance Attribute Details
#initial_args ⇒ Object
Returns the value of attribute initial_args.
7 8 9 |
# File 'lib/envoi/mam/agent/base_daemon.rb', line 7 def initial_args @initial_args end |
#logger ⇒ Object
Returns the value of attribute logger.
7 8 9 |
# File 'lib/envoi/mam/agent/base_daemon.rb', line 7 def logger @logger end |
Instance Method Details
#set_instance_variables(args = nil) ⇒ Object
Processes a hash and creates instance variables for each key set to it’s corresponding value If args is an array then it processes the first hash it comes to in that array (Good for passing *args from a previous method)
17 18 19 20 21 |
# File 'lib/envoi/mam/agent/base_daemon.rb', line 17 def set_instance_variables(args = nil) _args = args _args = _args.find { |v| v.is_a? Hash } if _args.is_a? Array _args.each { |key, val| instance_variable_set("@#{key}", val) } if _args.is_a? Hash end |