Class: EeePub::OCF::Container
- Inherits:
-
ContainerItem
- Object
- ContainerItem
- EeePub::OCF::Container
- Defined in:
- lib/eeepub/lib/eeepub/ocf.rb
Overview
Class for ‘container.xml’ of OCF
Instance Attribute Summary collapse
-
#rootfiles ⇒ Object
Returns the value of attribute rootfiles.
Instance Method Summary collapse
-
#initialize(arg) ⇒ Container
constructor
A new instance of Container.
Methods inherited from ContainerItem
Constructor Details
#initialize(arg) ⇒ Container
Returns a new instance of Container.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/eeepub/lib/eeepub/ocf.rb', line 27 def initialize(arg) case arg when String set_values( :rootfiles => [ {:full_path => arg, :media_type => guess_media_type(arg)} ] ) when Array # TODO: spec set_values( :rootfiles => arg.keys.map { |k| filename = arg[k] {:full_path => filename, :media_type => guess_media_type(filename)} } ) when Hash set_values(arg) end end |
Instance Attribute Details
#rootfiles ⇒ Object
Returns the value of attribute rootfiles.
8 9 10 |
# File 'lib/eeepub/lib/eeepub/ocf.rb', line 8 def rootfiles @rootfiles end |