Class: Maxwell::Agent::Host

Inherits:
Object
  • Object
show all
Defined in:
lib/maxwell/agent/host.rb,
lib/maxwell/agent/host/service.rb

Defined Under Namespace

Classes: Serializer, Service

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attributesObject (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

#serializeObject



31
32
33
# File 'lib/maxwell/agent/host.rb', line 31

def serialize
  Serializer.serialize(attributes.dup)
end

#servicesObject



40
41
42
# File 'lib/maxwell/agent/host.rb', line 40

def services
  @attributes[:services]
end