Class: DateExprNode
Instance Method Summary collapse
- #gen ⇒ Object
-
#initialize(val) ⇒ DateExprNode
constructor
A new instance of DateExprNode.
Methods inherited from Node
Constructor Details
#initialize(val) ⇒ DateExprNode
Returns a new instance of DateExprNode.
106 107 108 |
# File 'lib/code_generator.rb', line 106 def initialize val @value = val end |
Instance Method Details
#gen ⇒ Object
110 111 112 113 114 115 116 117 118 |
# File 'lib/code_generator.rb', line 110 def gen val = @value.gen if val == 'now' "Time.now.to_date" else # YYYY-MM-DD "Date.parse(\"#{val}\")" end end |