Class: DeplateString
- Inherits:
-
String
- Object
- String
- DeplateString
- Defined in:
- lib/deplate/deplate-string.rb
Class Attribute Summary collapse
-
.deplate_options ⇒ Object
readonly
Returns the value of attribute deplate_options.
Instance Attribute Summary collapse
-
#deplate_converter ⇒ Object
readonly
Returns the value of attribute deplate_converter.
-
#deplate_options ⇒ Object
readonly
Returns the value of attribute deplate_options.
-
#deplate_variables ⇒ Object
readonly
Returns the value of attribute deplate_variables.
Instance Method Summary collapse
- #deplate(fmt) ⇒ Object
-
#initialize(*args) ⇒ DeplateString
constructor
A new instance of DeplateString.
- #to_dbk ⇒ Object
- #to_html ⇒ Object
- #to_latex ⇒ Object
- #to_tex ⇒ Object
- #to_text ⇒ Object
- #to_xhtml ⇒ Object
- #with_deplate_options(&block) ⇒ Object
Constructor Details
#initialize(*args) ⇒ DeplateString
Returns a new instance of DeplateString.
24 25 26 27 |
# File 'lib/deplate/deplate-string.rb', line 24 def initialize(*args) @deplate_options = self.class..dup super end |
Class Attribute Details
.deplate_options ⇒ Object (readonly)
Returns the value of attribute deplate_options.
17 18 19 |
# File 'lib/deplate/deplate-string.rb', line 17 def @deplate_options end |
Instance Attribute Details
#deplate_converter ⇒ Object (readonly)
Returns the value of attribute deplate_converter.
22 23 24 |
# File 'lib/deplate/deplate-string.rb', line 22 def deplate_converter @deplate_converter end |
#deplate_options ⇒ Object (readonly)
Returns the value of attribute deplate_options.
20 21 22 |
# File 'lib/deplate/deplate-string.rb', line 20 def @deplate_options end |
#deplate_variables ⇒ Object (readonly)
Returns the value of attribute deplate_variables.
21 22 23 |
# File 'lib/deplate/deplate-string.rb', line 21 def deplate_variables @deplate_variables end |
Instance Method Details
#deplate(fmt) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/deplate/deplate-string.rb', line 33 def deplate(fmt) @deplate_converter = Deplate::Converter.new(fmt, :options => @deplate_options) rv = @deplate_converter.convert_string(self) @deplate_variables = @deplate_converter.deplate.variables rv end |
#to_dbk ⇒ Object
61 62 63 |
# File 'lib/deplate/deplate-string.rb', line 61 def to_dbk deplate('dbk-article') end |
#to_html ⇒ Object
41 42 43 |
# File 'lib/deplate/deplate-string.rb', line 41 def to_html deplate('html') end |
#to_latex ⇒ Object
49 50 51 |
# File 'lib/deplate/deplate-string.rb', line 49 def to_latex deplate('latex') end |
#to_tex ⇒ Object
53 54 55 |
# File 'lib/deplate/deplate-string.rb', line 53 def to_tex deplate('latex') end |
#to_text ⇒ Object
57 58 59 |
# File 'lib/deplate/deplate-string.rb', line 57 def to_text deplate('plain') end |
#to_xhtml ⇒ Object
45 46 47 |
# File 'lib/deplate/deplate-string.rb', line 45 def to_xhtml deplate('xhtml10t') end |
#with_deplate_options(&block) ⇒ Object
29 30 31 |
# File 'lib/deplate/deplate-string.rb', line 29 def (&block) block.call(@deplate_options) end |