Class: Sawyer::Actions
- Inherits:
-
Object
- Object
- Sawyer::Actions
- Includes:
- RawActions
- Defined in:
- lib/sawyer/actions.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(opts, action, args, logger) ⇒ Actions
constructor
A new instance of Actions.
Methods included from RawActions
Constructor Details
#initialize(opts, action, args, logger) ⇒ Actions
Returns a new instance of Actions.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/sawyer/actions.rb', line 21 def initialize opts, action, args, logger environment = opts[:environment].to_sym from = Chronic.parse(opts[:from]) to = Chronic.parse(opts[:to]) @prefix = opts[:prefix] @limit = opts[:limit] @action = action @args = args @logger = logger @status = 0 @elasticsearch = ENVIRONMENTS[environment.to_sym] @status = send action, from, to, args end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
19 20 21 |
# File 'lib/sawyer/actions.rb', line 19 def logger @logger end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
19 20 21 |
# File 'lib/sawyer/actions.rb', line 19 def status @status end |