Class: EPUBInfo::Models::Identifier
- Inherits:
-
Object
- Object
- EPUBInfo::Models::Identifier
- Defined in:
- lib/epubinfo/models/identifier.rb
Instance Attribute Summary collapse
-
#identifier ⇒ String
Identifier (EPUB2 reference).
-
#scheme ⇒ String
Scheme (EPUB2 reference).
Instance Method Summary collapse
-
#initialize(node) ⇒ Identifier
constructor
Should never be called directly, go through EPUBInfo.get.
-
#to_hash ⇒ Hash
Returns Hash representation of an identifier.
Constructor Details
#initialize(node) ⇒ Identifier
Should never be called directly, go through EPUBInfo.get
12 13 14 15 |
# File 'lib/epubinfo/models/identifier.rb', line 12 def initialize(node) self.identifier = node.content self.scheme = node.attribute('scheme').content rescue nil end |
Instance Attribute Details
#identifier ⇒ String
Identifier (EPUB2 reference)
6 7 8 |
# File 'lib/epubinfo/models/identifier.rb', line 6 def identifier @identifier end |
#scheme ⇒ String
Scheme (EPUB2 reference)
9 10 11 |
# File 'lib/epubinfo/models/identifier.rb', line 9 def scheme @scheme end |
Instance Method Details
#to_hash ⇒ Hash
Returns Hash representation of an identifier
19 20 21 22 23 24 |
# File 'lib/epubinfo/models/identifier.rb', line 19 def to_hash { :identifier => @identifier, :scheme => @scheme } end |