Class: Thepub::Epub::OPF::Metadata
- Inherits:
-
Struct
- Object
- Struct
- Thepub::Epub::OPF::Metadata
- Defined in:
- lib/thepub/epub/opf.rb
Instance Attribute Summary collapse
-
#creator ⇒ Object
Returns the value of attribute creator.
-
#date ⇒ Object
Returns the value of attribute date.
-
#description ⇒ Object
Returns the value of attribute description.
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#language ⇒ Object
Returns the value of attribute language.
-
#publisher ⇒ Object
Returns the value of attribute publisher.
-
#relation ⇒ Object
Returns the value of attribute relation.
-
#rights ⇒ Object
Returns the value of attribute rights.
-
#subject ⇒ Object
Returns the value of attribute subject.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
Instance Attribute Details
#creator ⇒ Object
Returns the value of attribute creator
21 22 23 |
# File 'lib/thepub/epub/opf.rb', line 21 def creator @creator end |
#date ⇒ Object
Returns the value of attribute date
21 22 23 |
# File 'lib/thepub/epub/opf.rb', line 21 def date @date end |
#description ⇒ Object
Returns the value of attribute description
21 22 23 |
# File 'lib/thepub/epub/opf.rb', line 21 def description @description end |
#identifier ⇒ Object
Returns the value of attribute identifier
21 22 23 |
# File 'lib/thepub/epub/opf.rb', line 21 def identifier @identifier end |
#language ⇒ Object
Returns the value of attribute language
21 22 23 |
# File 'lib/thepub/epub/opf.rb', line 21 def language @language end |
#publisher ⇒ Object
Returns the value of attribute publisher
21 22 23 |
# File 'lib/thepub/epub/opf.rb', line 21 def publisher @publisher end |
#relation ⇒ Object
Returns the value of attribute relation
21 22 23 |
# File 'lib/thepub/epub/opf.rb', line 21 def relation @relation end |
#rights ⇒ Object
Returns the value of attribute rights
21 22 23 |
# File 'lib/thepub/epub/opf.rb', line 21 def rights @rights end |
#subject ⇒ Object
Returns the value of attribute subject
21 22 23 |
# File 'lib/thepub/epub/opf.rb', line 21 def subject @subject end |
#title ⇒ Object
Returns the value of attribute title
21 22 23 |
# File 'lib/thepub/epub/opf.rb', line 21 def title @title end |
Instance Method Details
#to_xml(builder) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/thepub/epub/opf.rb', line 34 def to_xml(builder) builder. 'xmlns:dc' => "http://purl.org/dc/elements/1.1/", 'xmlns:dcterms' => "http://purl.org/dc/terms/", 'xmlns:xsi' => "http://www.w3.org/2001/XMLSchema-instance", 'xmlns:opf' => "http://www.idpf.org/2007/opf" do # Required elements builder.dc :title do builder << self.title end builder.dc :language, 'xsi:type' => "dcterms:RFC3066" do builder << self.language end builder.dc :identifier, :id => 'dcidid', 'opf:scheme' => 'URI' do builder << self.identifier end # Optional elements builder.dc :subject do builder << self.subject end if self.subject builder.dc :description do builder << self.description end if self.description builder.dc :relation do builder << self.relation end if self.relation builder.dc :creator, 'opf:role' => "aut" do # TODO: roles builder << self.creator end if self.creator builder.dc :publisher do builder << self.publisher end if self.publisher builder.dc :date do builder << self.date.to_s end if self.date builder.dc :rights do builder << self.rights end if self.rights end end |