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.
365 366 367 368 369 |
# File 'lib/archipelago/disco.rb', line 365 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) && hash[:validator].respond_to?(:valid?) super(hash) end |
Instance Method Details
#valid? ⇒ Boolean
Returns whether this service is still valid.
373 374 375 376 377 378 379 |
# File 'lib/archipelago/disco.rb', line 373 def valid? begin self[:validator].valid? rescue DRb::DRbError => e false end end |