Class: EPUB::Publication::Package::Bindings
- Inherits:
-
Object
- Object
- EPUB::Publication::Package::Bindings
- Includes:
- Inspector::PublicationModel
- Defined in:
- lib/epub/publication/package/bindings.rb
Defined Under Namespace
Classes: MediaType
Constant Summary
Constants included from Inspector::PublicationModel
Inspector::PublicationModel::TEMPLATE
Instance Attribute Summary collapse
-
#package ⇒ Object
Returns the value of attribute package.
Instance Method Summary collapse
- #<<(media_type) ⇒ Object
- #[](media_type) ⇒ Object
-
#initialize ⇒ Bindings
constructor
A new instance of Bindings.
- #media_types ⇒ Object
Methods included from Inspector::PublicationModel
Constructor Details
#initialize ⇒ Bindings
Returns a new instance of Bindings.
8 9 10 |
# File 'lib/epub/publication/package/bindings.rb', line 8 def initialize @media_types = {} end |
Instance Attribute Details
#package ⇒ Object
Returns the value of attribute package.
6 7 8 |
# File 'lib/epub/publication/package/bindings.rb', line 6 def package @package end |
Instance Method Details
#<<(media_type) ⇒ Object
12 13 14 |
# File 'lib/epub/publication/package/bindings.rb', line 12 def <<(media_type) @media_types[media_type.media_type] = media_type end |
#[](media_type) ⇒ Object
16 17 18 19 |
# File 'lib/epub/publication/package/bindings.rb', line 16 def [](media_type) _, mt = @media_types.detect {|key, _| key == media_type} mt end |
#media_types ⇒ Object
21 22 23 |
# File 'lib/epub/publication/package/bindings.rb', line 21 def media_types @media_types.values end |