Class: RGovData::RegistryStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/rgovdata/catalog/registry_strategy/registry_strategy.rb

Direct Known Subclasses

InternalRegistry

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(default_realm = nil) ⇒ RegistryStrategy

new accepts realm parameter



17
18
19
# File 'lib/rgovdata/catalog/registry_strategy/registry_strategy.rb', line 17

def initialize(default_realm=nil)
  @realm = default_realm
end

Instance Attribute Details

#realmObject

Returns the value of attribute realm.



2
3
4
# File 'lib/rgovdata/catalog/registry_strategy/registry_strategy.rb', line 2

def realm
  @realm
end

Class Method Details

.instance_for_realm(realm) ⇒ Object

Returns the appropriate RegistryStrategy for the given realm realm is the required realm



7
8
9
10
11
12
13
# File 'lib/rgovdata/catalog/registry_strategy/registry_strategy.rb', line 7

def instance_for_realm(realm)
  # TODO: this is where we can abstract different registry schemes
  # e.g by default we will look for a class called Rgovdata::<realm>Registry (Rgovdata::ZhRegistry)
  # else we take the default strategy
  # Currently this just defaults to internal registry:
  RGovData::InternalRegistry.new(realm)
end

Instance Method Details

#load_servicesObject

Returns the list of services for the realm



22
23
24
# File 'lib/rgovdata/catalog/registry_strategy/registry_strategy.rb', line 22

def load_services
  []
end