Class: RelatonBib::TypedUri
- Inherits:
-
Object
- Object
- RelatonBib::TypedUri
- Defined in:
- lib/relaton_bib/typed_uri.rb
Overview
Typed URI
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#type ⇒ Symbol
readonly
:src/:obp/:rss.
Instance Method Summary collapse
-
#initialize(type:, content:) ⇒ TypedUri
constructor
A new instance of TypedUri.
- #to_xml(builder) ⇒ Object
Constructor Details
#initialize(type:, content:) ⇒ TypedUri
Returns a new instance of TypedUri.
13 14 15 16 |
# File 'lib/relaton_bib/typed_uri.rb', line 13 def initialize(type:, content:) @type = type @content = Addressable::URI.parse content if content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
9 10 11 |
# File 'lib/relaton_bib/typed_uri.rb', line 9 def content @content end |
#type ⇒ Symbol (readonly)
Returns :src/:obp/:rss.
7 8 9 |
# File 'lib/relaton_bib/typed_uri.rb', line 7 def type @type end |
Instance Method Details
#to_xml(builder) ⇒ Object
18 19 20 |
# File 'lib/relaton_bib/typed_uri.rb', line 18 def to_xml(builder) builder.uri(content.to_s, type: type) end |