Class: EeePub::OCF::Container
- Inherits:
-
ContainerItem
- Object
- ContainerItem
- EeePub::OCF::Container
- Defined in:
- 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.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/eeepub/ocf.rb', line 25 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.
6 7 8 |
# File 'lib/eeepub/ocf.rb', line 6 def rootfiles @rootfiles end |