Sha256: d2adae733164ed64cdf531c12e244f0700bab79b54d0f8f581eab454ce1fbd39

Contents?: true

Size: 608 Bytes

Versions: 38

Compression:

Stored size: 608 Bytes

Contents

module EPUB
  module Publication
    class Package
      class Bindings
        include Inspector::PublicationModel
        attr_accessor :package

        def initialize
          @media_types = {}
        end

        def <<(media_type)
          @media_types[media_type.media_type] = media_type
        end

        def [](media_type)
          _, mt = @media_types.detect {|key, _| key == media_type}
          mt
        end

        def media_types
          @media_types.values
        end

        class MediaType
          attr_accessor :media_type, :handler
        end
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 2 rubygems

Version Path
epub-parser-0.4.8 lib/epub/publication/package/bindings.rb
epub-parser-0.4.7 lib/epub/publication/package/bindings.rb
epub-parser-0.4.6 lib/epub/publication/package/bindings.rb
epub-parser-0.4.5 lib/epub/publication/package/bindings.rb
epub-parser-0.4.4 lib/epub/publication/package/bindings.rb
epub-parser-0.4.3 lib/epub/publication/package/bindings.rb
epub-parser-0.4.2 lib/epub/publication/package/bindings.rb
epub-parser-0.4.1 lib/epub/publication/package/bindings.rb
epub-parser-0.4.0 lib/epub/publication/package/bindings.rb
epub-parser-0.3.9 lib/epub/publication/package/bindings.rb
epub-parser-0.3.8 lib/epub/publication/package/bindings.rb
epub-parser-0.3.7 lib/epub/publication/package/bindings.rb
epub-parser-0.3.6 lib/epub/publication/package/bindings.rb
epub-parser-0.3.5 lib/epub/publication/package/bindings.rb
epub-parser-0.3.4 lib/epub/publication/package/bindings.rb
epub-parser-0.3.3 lib/epub/publication/package/bindings.rb
epub-parser-0.3.2 lib/epub/publication/package/bindings.rb
epub-parser-0.3.1 lib/epub/publication/package/bindings.rb
epub-parser-0.3.0 lib/epub/publication/package/bindings.rb
epub-parser-0.2.9 lib/epub/publication/package/bindings.rb