Sha256: 0c0d31699fb56af809516eddd4e91af7cbaaed545cd8e2e16a04cbe13730e1de

Contents?: true

Size: 444 Bytes

Versions: 1

Compression:

Stored size: 444 Bytes

Contents

module EPUBInfo
  module Models
    class Person
      attr_accessor :name, :file_as, :role

      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

      def to_hash
        {
          :name => @name,
          :file_as => @file_as,
          :role => @role
        }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
epubinfo-0.2.2 lib/epubinfo/models/person.rb