Sha256: cf0d5122c3a38cfbd7bdc9b8c33e8677706880512bc741d717e3e957eaa3ea40

Contents?: true

Size: 780 Bytes

Versions: 21

Compression:

Stored size: 780 Bytes

Contents

module EPUBInfo
  module Models
    class Identifier
      # Identifier ({http://idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.2.1 EPUB2 reference})
      # @return [String]
      attr_accessor :identifier
      # Scheme ({http://idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.2.1 EPUB2 reference})
      # @return [String]
      attr_accessor :scheme

      # Should never be called directly, go through EPUBInfo.get
      def initialize(node)
        self.identifier = node.content
        self.scheme = node.attribute('scheme').content rescue nil
      end

      # Returns Hash representation of an identifier
      # @return [Hash]
      def to_hash
        {
          :identifier => @identifier,
          :scheme => @scheme
        }
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
epubinfo_with_toc-0.5.7 lib/epubinfo/models/identifier.rb
epubinfo-0.4.4 lib/epubinfo/models/identifier.rb
epubinfo_with_toc-0.5.6 lib/epubinfo/models/identifier.rb
epubinfo_with_toc-0.5.5 lib/epubinfo/models/identifier.rb
epubinfo_with_toc-0.5.4 lib/epubinfo/models/identifier.rb
epubinfo_with_toc-0.5.2 lib/epubinfo/models/identifier.rb
epubinfo_with_toc-0.5.0 lib/epubinfo/models/identifier.rb
epubinfo_with_toc-0.4.5 lib/epubinfo/models/identifier.rb
epubinfo-0.4.3 lib/epubinfo/models/identifier.rb
epubinfo-0.4.2 lib/epubinfo/models/identifier.rb
epubinfo-0.4.1 lib/epubinfo/models/identifier.rb
epubinfo-0.4.0 lib/epubinfo/models/identifier.rb
epubinfo-0.3.6 lib/epubinfo/models/identifier.rb
epubinfo-0.3.5 lib/epubinfo/models/identifier.rb
epubinfo-0.3.4 lib/epubinfo/models/identifier.rb
epubinfo-0.3.3 lib/epubinfo/models/identifier.rb
epubinfo-0.3.2 lib/epubinfo/models/identifier.rb
epubinfo-0.3.1 lib/epubinfo/models/identifier.rb
epubinfo-0.3.0 lib/epubinfo/models/identifier.rb
epubinfo-0.2.4 lib/epubinfo/models/identifier.rb