Class: CC2HTML::Converter
- Inherits:
-
Object
- Object
- CC2HTML::Converter
- Defined in:
- lib/cc2html/converter.rb
Instance Attribute Summary collapse
-
#cc_file_path ⇒ Object
readonly
Returns the value of attribute cc_file_path.
-
#dest_dir ⇒ Object
readonly
Returns the value of attribute dest_dir.
Instance Method Summary collapse
- #convert ⇒ Object
-
#initialize(cc_file_path, dest_name, options = {}) ⇒ Converter
constructor
A new instance of Converter.
Constructor Details
#initialize(cc_file_path, dest_name, options = {}) ⇒ Converter
Returns a new instance of Converter.
5 6 7 8 9 |
# File 'lib/cc2html/converter.rb', line 5 def initialize(cc_file_path, dest_name, ={}) @cc_file_path = cc_file_path @dest_name = dest_name @settings = end |
Instance Attribute Details
#cc_file_path ⇒ Object (readonly)
Returns the value of attribute cc_file_path.
3 4 5 |
# File 'lib/cc2html/converter.rb', line 3 def cc_file_path @cc_file_path end |
#dest_dir ⇒ Object (readonly)
Returns the value of attribute dest_dir.
3 4 5 |
# File 'lib/cc2html/converter.rb', line 3 def dest_dir @dest_dir end |
Instance Method Details
#convert ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/cc2html/converter.rb', line 11 def convert manifest = IMS::CC::Manifest.read(@cc_file_path) if @settings[:format] == 'html' CC2HTML::HtmlBuilder.new(manifest, @dest_name, @cc_file_path).generate elsif @settings[:format] == 'epub' CC2HTML::EpubBuilder.new(manifest, @dest_name, @cc_file_path, @settings).generate end end |