Class: Mamiya::Agent::Handlers::Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/mamiya/agent/handlers/abstract.rb

Direct Known Subclasses

Task

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(agent, event) ⇒ Abstract

Returns a new instance of Abstract.



7
8
9
10
11
# File 'lib/mamiya/agent/handlers/abstract.rb', line 7

def initialize(agent, event)
  @agent = agent
  @event = event
  @payload = (event.payload && !event.payload.empty?) ? JSON.parse(event.payload) : {}
end

Instance Attribute Details

#agentObject (readonly)

Returns the value of attribute agent.



13
14
15
# File 'lib/mamiya/agent/handlers/abstract.rb', line 13

def agent
  @agent
end

#eventObject (readonly)

Returns the value of attribute event.



13
14
15
# File 'lib/mamiya/agent/handlers/abstract.rb', line 13

def event
  @event
end

#payloadObject (readonly)

Returns the value of attribute payload.



13
14
15
# File 'lib/mamiya/agent/handlers/abstract.rb', line 13

def payload
  @payload
end

Instance Method Details

#run!Object



15
16
# File 'lib/mamiya/agent/handlers/abstract.rb', line 15

def run!
end