class EPUBMeta::Models::Person

Attributes

file_as[RW]

File as ({idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.2.6 EPUB2 reference}) @return [String]

name[RW]

Name ({idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.2.6 EPUB2 reference}) @return [String]

role[RW]

Role ({idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.2.6 EPUB2 reference}) @return [String]

Public Class Methods

new(node) click to toggle source

Should never be called directly, go through EPUBMeta.get

# File lib/epubmeta/models/person.rb, line 15
def initialize(node)
  self.name = node.content
  self.file_as = node.attribute('file-as').content rescue nil
  self.role = node.attribute('role').content rescue nil
end

Public Instance Methods

to_hash() click to toggle source

Returns Hash representation of a person @return [Hash]

# File lib/epubmeta/models/person.rb, line 23
def to_hash
  {
    :name => @name,
    :file_as => @file_as,
    :role => @role
  }
end