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.



13
14
15
16
# File 'lib/maxwell/agent/host.rb', line 13

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



22
23
24
# File 'lib/maxwell/agent/host.rb', line 22

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

#add_service(service) ⇒ Object



18
19
20
# File 'lib/maxwell/agent/host.rb', line 18

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