Class: Longleaf::ServiceRecord
- Inherits:
-
Object
- Object
- Longleaf::ServiceRecord
- Defined in:
- lib/longleaf/models/service_record.rb
Overview
Record for an individual service in a file’s metadata record.
Instance Attribute Summary collapse
-
#failure_timestamp ⇒ Object
Returns the value of attribute failure_timestamp.
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
-
#run_needed ⇒ Object
Returns the value of attribute run_needed.
-
#stale_replicas ⇒ Object
Returns the value of attribute stale_replicas.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#[](key) ⇒ Object
The value of a service property identified by key.
-
#[]=(key, value) ⇒ Object
set the value of a service property identified by key.
-
#initialize(properties: Hash.new, stale_replicas: false, timestamp: nil, run_needed: false) ⇒ ServiceRecord
constructor
A new instance of ServiceRecord.
Constructor Details
#initialize(properties: Hash.new, stale_replicas: false, timestamp: nil, run_needed: false) ⇒ ServiceRecord
Returns a new instance of ServiceRecord.
12 13 14 15 16 17 18 19 |
# File 'lib/longleaf/models/service_record.rb', line 12 def initialize(properties: Hash.new, stale_replicas: false, timestamp: nil, run_needed: false) raise ArgumentError.new("Service properties must be a hash") if properties.class != Hash @properties = properties @timestamp = @stale_replicas = stale_replicas @run_needed = run_needed end |
Instance Attribute Details
#failure_timestamp ⇒ Object
Returns the value of attribute failure_timestamp.
6 7 8 |
# File 'lib/longleaf/models/service_record.rb', line 6 def @failure_timestamp end |
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
4 5 6 |
# File 'lib/longleaf/models/service_record.rb', line 4 def properties @properties end |
#run_needed ⇒ Object
Returns the value of attribute run_needed.
5 6 7 |
# File 'lib/longleaf/models/service_record.rb', line 5 def run_needed @run_needed end |
#stale_replicas ⇒ Object
Returns the value of attribute stale_replicas.
5 6 7 |
# File 'lib/longleaf/models/service_record.rb', line 5 def stale_replicas @stale_replicas end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
5 6 7 |
# File 'lib/longleaf/models/service_record.rb', line 5 def @timestamp end |
Instance Method Details
#[](key) ⇒ Object
Returns the value of a service property identified by key.
22 23 24 |
# File 'lib/longleaf/models/service_record.rb', line 22 def [](key) @properties[key] end |
#[]=(key, value) ⇒ Object
set the value of a service property identified by key
27 28 29 |
# File 'lib/longleaf/models/service_record.rb', line 27 def []=(key, value) @properties[key] = value end |