Class: Maxwell::Agent::Host

Inherits:
Object
  • Object
show all
Includes:
DynamicAttributes
Defined in:
lib/maxwell/agent/host.rb

Defined Under Namespace

Classes: Service

Instance Method Summary collapse

Methods included from DynamicAttributes

#method_missing

Constructor Details

#initialize(attrs = {}) ⇒ Host

Returns a new instance of Host.



15
16
17
18
# File 'lib/maxwell/agent/host.rb', line 15

def initialize(attrs={})
  @services ||= []
  @hosts ||= []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Maxwell::Agent::DynamicAttributes

Instance Method Details

#add_host(host) ⇒ Object



24
25
26
# File 'lib/maxwell/agent/host.rb', line 24

def add_host(host)
  self.hosts << host
end

#add_service(service) ⇒ Object



20
21
22
# File 'lib/maxwell/agent/host.rb', line 20

def add_service(service)
  self.services << service
end