Class: OpenURL::ScholarlyServiceType
- Inherits:
-
ContextObjectEntity
- Object
- ContextObjectEntity
- OpenURL::ScholarlyServiceType
- Defined in:
- lib/openurl/metadata_formats/scholarly_service_type.rb
Instance Attribute Summary
Attributes inherited from ContextObjectEntity
#abbr, #format, #identifiers, #label, #metadata, #private_data, #reference
Instance Method Summary collapse
-
#initialize ⇒ ScholarlyServiceType
constructor
A new instance of ScholarlyServiceType.
- #method_missing(metadata, value = nil) ⇒ Object
Methods inherited from ContextObjectEntity
#add_identifier, #delete_identifier, #empty?, #get_metadata, #identifier, #import_xml_metadata, #kev, new_from_format, normalize_id, #serialize_metadata, #set_format, #set_metadata, #set_private_data, #set_reference, #to_hash, #xml, #xml_for_ref_entity
Constructor Details
#initialize ⇒ ScholarlyServiceType
Returns a new instance of ScholarlyServiceType.
13 14 15 16 17 18 19 |
# File 'lib/openurl/metadata_formats/scholarly_service_type.rb', line 13 def initialize super @format = 'sch_svc' @metadata_keys = ['abstract','citation','fulltext','holdings','ill','any'] @xml_ns = "info:ofi/fmt:xml:xsd:sch_svc" @kev_ns = "info:ofi/fmt:kev:mtx:sch_svc" end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(metadata, value = nil) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/openurl/metadata_formats/scholarly_service_type.rb', line 21 def method_missing(, value=nil) = .to_s.sub(/=$/,'') raise ArgumentError, "#{.to_s} is not a valid #{self.class} metadata field." unless @metadata_keys.index() if .to_s.match(/=$/) self.(, value) else return self.[] end end |