Class: EpubWorm::Metadata
- Inherits:
-
Object
- Object
- EpubWorm::Metadata
- Defined in:
- lib/epub_worm/metadata.rb
Instance Attribute Summary collapse
-
#authors ⇒ Object
Returns the value of attribute authors.
-
#description ⇒ Object
Returns the value of attribute description.
-
#language ⇒ Object
Returns the value of attribute language.
-
#published_at ⇒ Object
Returns the value of attribute published_at.
-
#publisher ⇒ Object
Returns the value of attribute publisher.
-
#subjects ⇒ Object
Returns the value of attribute subjects.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(title: nil, authors: [], language: nil, publisher: nil, description: nil, published_at: nil, subjects: []) ⇒ Metadata
constructor
A new instance of Metadata.
- #to_h ⇒ Object
Constructor Details
#initialize(title: nil, authors: [], language: nil, publisher: nil, description: nil, published_at: nil, subjects: []) ⇒ Metadata
Returns a new instance of Metadata.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/epub_worm/metadata.rb', line 7 def initialize( title: nil, authors: [], language: nil, publisher: nil, description: nil, published_at: nil, subjects: [] ) @title = title = @language = language @publisher = publisher @description = description @published_at = published_at @subjects = subjects end |
Instance Attribute Details
#authors ⇒ Object
Returns the value of attribute authors.
5 6 7 |
# File 'lib/epub_worm/metadata.rb', line 5 def end |
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/epub_worm/metadata.rb', line 5 def description @description end |
#language ⇒ Object
Returns the value of attribute language.
5 6 7 |
# File 'lib/epub_worm/metadata.rb', line 5 def language @language end |
#published_at ⇒ Object
Returns the value of attribute published_at.
5 6 7 |
# File 'lib/epub_worm/metadata.rb', line 5 def published_at @published_at end |
#publisher ⇒ Object
Returns the value of attribute publisher.
5 6 7 |
# File 'lib/epub_worm/metadata.rb', line 5 def publisher @publisher end |
#subjects ⇒ Object
Returns the value of attribute subjects.
5 6 7 |
# File 'lib/epub_worm/metadata.rb', line 5 def subjects @subjects end |
#title ⇒ Object
Returns the value of attribute title.
5 6 7 |
# File 'lib/epub_worm/metadata.rb', line 5 def title @title end |
Instance Method Details
#to_h ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/epub_worm/metadata.rb', line 25 def to_h { title: title, authors: , language: language, publisher: publisher, description: description, published_at: published_at, subjects: subjects } end |