Class: Walrus::Grammar::RubyExpression
- Inherits:
-
Walrat::Node
- Object
- Walrat::Node
- Walrus::Grammar::RubyExpression
- Defined in:
- lib/walrus/grammar/ruby_expression.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#compile(options = {}) ⇒ Object
Rather than just compiling Ruby expressions back to text in a generic fashion it is desirable to compile the pieces separately (for an example, see the AssignmentExpression class) because this allows us to handle placeholders embedded inside Ruby expressions.
Instance Method Details
#compile(options = {}) ⇒ Object
Rather than just compiling Ruby expressions back to text in a generic fashion it is desirable to compile the pieces separately (for an example, see the AssignmentExpression class) because this allows us to handle placeholders embedded inside Ruby expressions.
Nevertheless, at an abstract level we here supply a default compilation method which just returns the source text, suitable for evaluation. Subclasses can then override this as new cases are discovered which require piece-by-piece compilation.
37 38 39 |
# File 'lib/walrus/grammar/ruby_expression.rb', line 37 def compile = {} source_text end |