Class: Maxwell::Agent::Host::Service
- Inherits:
-
Object
- Object
- Maxwell::Agent::Host::Service
- Extended by:
- Forwardable
- Includes:
- Work
- Defined in:
- lib/maxwell/agent/host/service.rb
Defined Under Namespace
Classes: Serializer
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Service
constructor
A new instance of Service.
- #serialize ⇒ Object
- #to_json ⇒ Object
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
#attributes ⇒ Object (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
#serialize ⇒ Object
38 39 40 |
# File 'lib/maxwell/agent/host/service.rb', line 38 def serialize Serializer.serialize(attributes.dup) end |
#to_json ⇒ Object
42 43 44 |
# File 'lib/maxwell/agent/host/service.rb', line 42 def to_json serialize end |