Class: Atomy::Code::Pattern::QuasiQuote::Constructor
- Defined in:
- lib/atomy/code/pattern/quasi_quote.rb
Instance Attribute Summary collapse
-
#locals ⇒ Object
readonly
Returns the value of attribute locals.
Instance Method Summary collapse
- #go(x) ⇒ Object
-
#initialize(mod) ⇒ Constructor
constructor
A new instance of Constructor.
- #unquote(x) ⇒ Object
- #visit(x) ⇒ Object
Methods inherited from Walker
#visit_quasiquote, #visit_unquote
Constructor Details
#initialize(mod) ⇒ Constructor
Returns a new instance of Constructor.
64 65 66 67 68 |
# File 'lib/atomy/code/pattern/quasi_quote.rb', line 64 def initialize(mod) super() @module = mod end |
Instance Attribute Details
#locals ⇒ Object (readonly)
Returns the value of attribute locals.
62 63 64 |
# File 'lib/atomy/code/pattern/quasi_quote.rb', line 62 def locals @locals end |
Instance Method Details
#go(x) ⇒ Object
70 71 72 |
# File 'lib/atomy/code/pattern/quasi_quote.rb', line 70 def go(x) x.accept(self) end |
#unquote(x) ⇒ Object
80 81 82 83 84 |
# File 'lib/atomy/code/pattern/quasi_quote.rb', line 80 def unquote(x) x.through do |p| @module.pattern(p) end end |
#visit(x) ⇒ Object
74 75 76 77 78 |
# File 'lib/atomy/code/pattern/quasi_quote.rb', line 74 def visit(x) x.through do |v| go(v) end end |