Class: Newsmlg2::Catalog
- Inherits:
-
NarModel
- Object
- NarModel
- Newsmlg2::Catalog
- Defined in:
- lib/newsmlg2/catalog.rb
Overview
A local or remote catalog: a set of scheme alias-to-URI declarations.
Instance Method Summary collapse
- #get_scheme_for_alias(alias_name) ⇒ Object
- #get_scheme_for_uri(uri) ⇒ Object
- #length ⇒ Object
- #to_s ⇒ Object
Methods included from Base::AuthorityAttributes
Methods included from Base::CommonPowerAttributes
Instance Method Details
#get_scheme_for_alias(alias_name) ⇒ Object
20 21 22 |
# File 'lib/newsmlg2/catalog.rb', line 20 def get_scheme_for_alias(alias_name) schemes.find { |scheme| scheme.alias_attr == alias_name } end |
#get_scheme_for_uri(uri) ⇒ Object
24 25 26 |
# File 'lib/newsmlg2/catalog.rb', line 24 def get_scheme_for_uri(uri) schemes.find { |scheme| scheme.uri == uri } end |
#length ⇒ Object
28 29 30 |
# File 'lib/newsmlg2/catalog.rb', line 28 def length schemes.length end |
#to_s ⇒ Object
32 33 34 35 36 |
# File 'lib/newsmlg2/catalog.rb', line 32 def to_s return '<Catalog>' if titles.empty? "<Catalog \"#{titles.first}\">" end |