lib/epubinfo/models/person.rb in epubinfo-0.2.2 vs lib/epubinfo/models/person.rb in epubinfo-0.2.3
- old
+ new
@@ -1,15 +1,26 @@
module EPUBInfo
module Models
class Person
- attr_accessor :name, :file_as, :role
+ # Name ({http://idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.2.6 EPUB2 reference})
+ # @return [String]
+ attr_accessor :name
+ # File as ({http://idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.2.6 EPUB2 reference})
+ # @return [String]
+ attr_accessor :file_as
+ # Role ({http://idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.2.6 EPUB2 reference})
+ # @return [String]
+ attr_accessor :role
+ # Should never be called directly, go through EPUBInfo.get
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
+ # Returns Hash representation of a person
+ # @return [Hash]
def to_hash
{
:name => @name,
:file_as => @file_as,
:role => @role