Class: Archipelago::Disco::Record
- Inherits:
-
ServiceDescription
- Object
- ServiceDescription
- Archipelago::Disco::Record
- Defined in:
- lib/archipelago/disco.rb
Overview
A class used to define an existing service.
Constant Summary
Constants inherited from ServiceDescription
ServiceDescription::IGNORABLE_ATTRIBUTES
Instance Attribute Summary
Attributes inherited from ServiceDescription
Instance Method Summary collapse
-
#initialize(hash) ⇒ Record
constructor
Initialize this Record with a hash that must contain an :service_id and a :validator.
-
#valid? ⇒ Boolean
Returns whether this service is still valid.
Methods inherited from ServiceDescription
Constructor Details
#initialize(hash) ⇒ Record
Initialize this Record with a hash that must contain an :service_id and a :validator.
257 258 259 260 261 |
# File 'lib/archipelago/disco.rb', line 257 def initialize(hash) raise "Record must have a :service_id" unless hash.include?(:service_id) raise "Record must have a :validator" unless hash.include?(:validator) super(hash) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Archipelago::Disco::ServiceDescription
Instance Method Details
#valid? ⇒ Boolean
Returns whether this service is still valid.
265 266 267 268 269 270 271 |
# File 'lib/archipelago/disco.rb', line 265 def valid? begin self[:validator].valid? rescue DRb::DRbError => e false end end |