Class: Cutaneous::Compiler::Text
- Inherits:
-
Expression
- Object
- Expression
- Cutaneous::Compiler::Text
- Defined in:
- lib/cutaneous/compiler/expression.rb
Instance Method Summary collapse
-
#initialize(expression, strip_whitespace = false) ⇒ Text
constructor
A new instance of Text.
- #to_script ⇒ Object
Methods inherited from Expression
Constructor Details
#initialize(expression, strip_whitespace = false) ⇒ Text
Returns a new instance of Text.
32 33 34 35 36 37 38 39 |
# File 'lib/cutaneous/compiler/expression.rb', line 32 def initialize(expression, strip_whitespace = false) @whitespace = "" if strip_whitespace && expression =~ BEGINNING_WHITESPACE @whitespace = $1 expression.slice!(0, @whitespace.length) end super(expression) end |
Instance Method Details
#to_script ⇒ Object
41 42 43 |
# File 'lib/cutaneous/compiler/expression.rb', line 41 def to_script %(__buf << %Q`) << @expression << %(` ; ) << @whitespace << ";" end |