Class: RGovData::ServiceListing
- Inherits:
-
Object
- Object
- RGovData::ServiceListing
- Includes:
- Dn
- Defined in:
- lib/rgovdata/service/listing.rb
Overview
A ServiceListing is the metadata describing a specific service It encapsulates access to the underlying service
Instance Attribute Summary collapse
-
#credentialset ⇒ Object
name of the credential set required.
-
#description ⇒ Object
human description of the service.
-
#info_uri ⇒ Object
url to a web page about the service if any.
-
#key ⇒ Object
(also: #service_key)
unique service name or id (within realm).
-
#keywords ⇒ Object
keywords for the service.
-
#license ⇒ Object
license covering the service if any.
-
#name ⇒ Object
human name of the service.
-
#publisher ⇒ Object
service publisher name.
-
#realm ⇒ Object
realm for the service.
-
#type ⇒ Object
service type [:odata,:csv,:file].
-
#uri ⇒ Object
url to the service interface.
Instance Method Summary collapse
-
#datasets ⇒ Object
(also: #records)
Returns an array of DataSets for the service => delegate to service.
-
#find(id) ⇒ Object
(also: #find_by_id)
Returns the first dataset matching
key
=> delegate to service. -
#get_dataset(key) ⇒ Object
Returns the dataset(s) matching
key
=> delegate to service. -
#service ⇒ Object
Returns the service for this listing.
Methods included from Dn
#attributes, #id, #initialization_hash, #meta_attributes, #to_param, #to_s
Instance Attribute Details
#credentialset ⇒ Object
name of the credential set required
14 15 16 |
# File 'lib/rgovdata/service/listing.rb', line 14 def credentialset @credentialset end |
#description ⇒ Object
human description of the service
7 8 9 |
# File 'lib/rgovdata/service/listing.rb', line 7 def description @description end |
#info_uri ⇒ Object
url to a web page about the service if any
11 12 13 |
# File 'lib/rgovdata/service/listing.rb', line 11 def info_uri @info_uri end |
#key ⇒ Object Also known as: service_key
unique service name or id (within realm)
5 6 7 |
# File 'lib/rgovdata/service/listing.rb', line 5 def key @key end |
#keywords ⇒ Object
keywords for the service
8 9 10 |
# File 'lib/rgovdata/service/listing.rb', line 8 def keywords @keywords end |
#license ⇒ Object
license covering the service if any
10 11 12 |
# File 'lib/rgovdata/service/listing.rb', line 10 def license @license end |
#name ⇒ Object
human name of the service
6 7 8 |
# File 'lib/rgovdata/service/listing.rb', line 6 def name @name end |
#publisher ⇒ Object
service publisher name
9 10 11 |
# File 'lib/rgovdata/service/listing.rb', line 9 def publisher @publisher end |
#realm ⇒ Object
realm for the service
4 5 6 |
# File 'lib/rgovdata/service/listing.rb', line 4 def realm @realm end |
#type ⇒ Object
service type [:odata,:csv,:file]
13 14 15 |
# File 'lib/rgovdata/service/listing.rb', line 13 def type @type end |
#uri ⇒ Object
url to the service interface
12 13 14 |
# File 'lib/rgovdata/service/listing.rb', line 12 def uri @uri end |
Instance Method Details
#datasets ⇒ Object Also known as: records
Returns an array of DataSets for the service
> delegate to service
28 29 30 |
# File 'lib/rgovdata/service/listing.rb', line 28 def datasets service.try(:datasets) end |
#find(id) ⇒ Object Also known as: find_by_id
Returns the first dataset matching key
> delegate to service
40 41 42 |
# File 'lib/rgovdata/service/listing.rb', line 40 def find(id) service.try(:find,id) end |
#get_dataset(key) ⇒ Object
Returns the dataset(s) matching key
> delegate to service
35 36 37 |
# File 'lib/rgovdata/service/listing.rb', line 35 def get_dataset(key) service.try(:get_dataset,key) end |
#service ⇒ Object
Returns the service for this listing
19 20 21 |
# File 'lib/rgovdata/service/listing.rb', line 19 def service @service ||= RGovData::Service.get_instance(self) end |