Class: TwoWaySQL::WhiteSpaceNode
Instance Method Summary collapse
- #accept(ctx) ⇒ Object
-
#initialize(val, preserve) ⇒ WhiteSpaceNode
constructor
A new instance of WhiteSpaceNode.
Constructor Details
#initialize(val, preserve) ⇒ WhiteSpaceNode
Returns a new instance of WhiteSpaceNode.
223 224 225 226 |
# File 'lib/twowaysql/node.rb', line 223 def initialize(val, preserve) @val = val @preserve = preserve end |
Instance Method Details
#accept(ctx) ⇒ Object
227 228 229 230 231 232 233 |
# File 'lib/twowaysql/node.rb', line 227 def accept(ctx) if @preserve ctx.add_sql(@val) else ctx.add_sql(" ") end end |