Class: Logux::ActionCaller

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/logux/action_caller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action:, meta:) ⇒ ActionCaller

Returns a new instance of ActionCaller.



11
12
13
14
# File 'lib/logux/action_caller.rb', line 11

def initialize(action:, meta:)
  @action = action
  @meta = meta
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



7
8
9
# File 'lib/logux/action_caller.rb', line 7

def action
  @action
end

#metaObject (readonly)

Returns the value of attribute meta.



7
8
9
# File 'lib/logux/action_caller.rb', line 7

def meta
  @meta
end

Instance Method Details

#call!Object



16
17
18
19
20
21
# File 'lib/logux/action_caller.rb', line 16

def call!
  Logux.watch_action { call_action }
rescue Logux::UnknownActionError, Logux::UnknownChannelError => e
  logger.warn(e)
  format(nil)
end