Class: Maxwell::Agent::Host::Service

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Work
Defined in:
lib/maxwell/agent/host/service.rb

Defined Under Namespace

Classes: Serializer

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Work

#evented?, #expected_next_run, #generate_rank, load, #perform, #verify_required_attributes!, #work_now?

Constructor Details

#initialize(attrs = {}) ⇒ Service

Returns a new instance of Service.



33
34
35
36
# File 'lib/maxwell/agent/host/service.rb', line 33

def initialize(attrs={})
  @attributes = Attributes.new(attrs)
  set_default_attrs!
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



6
7
8
# File 'lib/maxwell/agent/host/service.rb', line 6

def attributes
  @attributes
end

Instance Method Details

#serializeObject



38
39
40
# File 'lib/maxwell/agent/host/service.rb', line 38

def serialize
  Serializer.serialize(attributes.dup)
end

#to_jsonObject



42
43
44
# File 'lib/maxwell/agent/host/service.rb', line 42

def to_json
  serialize
end