Class: Markout::Output
- Inherits:
-
Object
- Object
- Markout::Output
- Defined in:
- lib/markout/output.rb
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#formatter ⇒ Object
readonly
Returns the value of attribute formatter.
Instance Method Summary collapse
- #export(to_file = false) ⇒ Object
-
#initialize(path, options = {}) ⇒ Output
constructor
A new instance of Output.
- #output_path ⇒ Object
Constructor Details
#initialize(path, options = {}) ⇒ Output
Returns a new instance of Output.
7 8 9 10 11 12 13 14 |
# File 'lib/markout/output.rb', line 7 def initialize(path, = {}) @path = path = @document = Document.new(@path, :history => [:history]) @format = [:format] || 'html' @formatter = pick_formatter.new( @document, :template => [:template] || 'default' ) @output = '' end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
5 6 7 |
# File 'lib/markout/output.rb', line 5 def document @document end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
5 6 7 |
# File 'lib/markout/output.rb', line 5 def format @format end |
#formatter ⇒ Object (readonly)
Returns the value of attribute formatter.
5 6 7 |
# File 'lib/markout/output.rb', line 5 def formatter @formatter end |
Instance Method Details
#export(to_file = false) ⇒ Object
16 17 18 19 20 |
# File 'lib/markout/output.rb', line 16 def export(to_file=false) @output = @formatter.export write_file if to_file return @output end |
#output_path ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/markout/output.rb', line 22 def output_path if [:output] File.join( File.( [:output] ), @formatter.filename ) else @document.base_path.join(@formatter.filename) end end |