Class: Reacter::Agent
- Inherits:
-
Object
- Object
- Reacter::Agent
- Defined in:
- lib/reacter/agent.rb
Direct Known Subclasses
DeciderAgent, FilterAgent, LoggerAgent, RelayAgent, RunnerAgent
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Agent
constructor
A new instance of Agent.
- #received(message) ⇒ Object
Constructor Details
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
10 11 12 |
# File 'lib/reacter/agent.rb', line 10 def config @config end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
11 12 13 |
# File 'lib/reacter/agent.rb', line 11 def type @type end |
Class Method Details
.create(type) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/reacter/agent.rb', line 24 def create(type) if type begin agentpath = Reacter['global.agents.path'] $: << File.(agentpath) if agentpath require "reacter/agents/#{type}" rv = (Reacter.const_get("#{type.capitalize}Agent").new()) return rv rescue LoadError STDERR.puts("#{e.class.name}: #{e.}") end end nil end |
Instance Method Details
#received(message) ⇒ Object
19 20 21 |
# File 'lib/reacter/agent.rb', line 19 def received() false end |