Class: DocFrac::Format
- Inherits:
-
Object
- Object
- DocFrac::Format
- Defined in:
- lib/doc_frac/format.rb
Instance Attribute Summary collapse
-
#ext ⇒ Object
readonly
Returns the value of attribute ext.
-
#format_text ⇒ Object
readonly
Returns the value of attribute format_text.
Instance Method Summary collapse
-
#initialize(format) ⇒ Format
constructor
A new instance of Format.
Constructor Details
#initialize(format) ⇒ Format
Returns a new instance of Format.
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/doc_frac/format.rb', line 4 def initialize(format) formats = { :to_rtf => "--to-rtf", :from_rtf => "--from-rtf", :to_html => "--to-html", :from_html => "--from-html", :to_text => "--to-text", :from_text => "--from-text" } @format_text = formats[format] @ext = format.to_s.split("_").last end |
Instance Attribute Details
#ext ⇒ Object (readonly)
Returns the value of attribute ext.
3 4 5 |
# File 'lib/doc_frac/format.rb', line 3 def ext @ext end |
#format_text ⇒ Object (readonly)
Returns the value of attribute format_text.
3 4 5 |
# File 'lib/doc_frac/format.rb', line 3 def format_text @format_text end |