Class: Maxwell::Agent::Host
- Inherits:
-
Object
- Object
- Maxwell::Agent::Host
- Defined in:
- lib/maxwell/agent/host.rb,
lib/maxwell/agent/host/service.rb
Defined Under Namespace
Classes: Serializer, Service
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
- #add_service(service) ⇒ Object
-
#initialize(attrs = {}) ⇒ Host
constructor
A new instance of Host.
- #serialize ⇒ Object
- #services ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ Host
Returns a new instance of Host.
26 27 28 29 |
# File 'lib/maxwell/agent/host.rb', line 26 def initialize(attrs={}) @attributes = Attributes.new(attrs) @attributes.services ||= [] end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
4 5 6 |
# File 'lib/maxwell/agent/host.rb', line 4 def attributes @attributes end |
Instance Method Details
#add_service(service) ⇒ Object
36 37 38 |
# File 'lib/maxwell/agent/host.rb', line 36 def add_service(service) @attributes[:services] << service end |
#serialize ⇒ Object
31 32 33 |
# File 'lib/maxwell/agent/host.rb', line 31 def serialize Serializer.serialize(attributes.dup) end |
#services ⇒ Object
40 41 42 |
# File 'lib/maxwell/agent/host.rb', line 40 def services @attributes[:services] end |