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
23 24 25 26 |
# File 'lib/deplate/deplate-string.rb', line 23 def initialize(*args) = self.class..dup super end |
Class Attribute Details
.deplate_options ⇒ Object (readonly)
Returns the value of attribute deplate_options.
16 17 18 |
# File 'lib/deplate/deplate-string.rb', line 16 def end |
Instance Attribute Details
#deplate_converter ⇒ Object (readonly)
Returns the value of attribute deplate_converter.
21 22 23 |
# File 'lib/deplate/deplate-string.rb', line 21 def deplate_converter @deplate_converter end |
#deplate_options ⇒ Object (readonly)
Returns the value of attribute deplate_options.
19 20 21 |
# File 'lib/deplate/deplate-string.rb', line 19 def end |
#deplate_variables ⇒ Object (readonly)
Returns the value of attribute deplate_variables.
20 21 22 |
# File 'lib/deplate/deplate-string.rb', line 20 def deplate_variables @deplate_variables end |
Instance Method Details
#deplate(fmt) ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/deplate/deplate-string.rb', line 32 def deplate(fmt) @deplate_converter = Deplate::Converter.new(fmt, :options => ) rv = @deplate_converter.convert_string(self) @deplate_variables = @deplate_converter.deplate.variables rv end |
#to_dbk ⇒ Object
60 61 62 |
# File 'lib/deplate/deplate-string.rb', line 60 def to_dbk deplate('dbk-article') end |
#to_html ⇒ Object
40 41 42 |
# File 'lib/deplate/deplate-string.rb', line 40 def to_html deplate('html') end |
#to_latex ⇒ Object
48 49 50 |
# File 'lib/deplate/deplate-string.rb', line 48 def to_latex deplate('latex') end |
#to_tex ⇒ Object
52 53 54 |
# File 'lib/deplate/deplate-string.rb', line 52 def to_tex deplate('latex') end |
#to_text ⇒ Object
56 57 58 |
# File 'lib/deplate/deplate-string.rb', line 56 def to_text deplate('plain') end |
#to_xhtml ⇒ Object
44 45 46 |
# File 'lib/deplate/deplate-string.rb', line 44 def to_xhtml deplate('xhtml10t') end |
#with_deplate_options(&block) ⇒ Object
28 29 30 |
# File 'lib/deplate/deplate-string.rb', line 28 def (&block) block.call() end |