Class: DocFrac::Format

Inherits:
Object
  • Object
show all
Defined in:
lib/doc_frac/format.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#extObject (readonly)

Returns the value of attribute ext.



3
4
5
# File 'lib/doc_frac/format.rb', line 3

def ext
  @ext
end

#format_textObject (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