Class: Atomy::Pattern::QuasiQuote
- Inherits:
-
Atomy::Pattern
- Object
- Atomy::Pattern
- Atomy::Pattern::QuasiQuote
- Defined in:
- lib/atomy/pattern/quasi_quote.rb
Defined Under Namespace
Classes: Constructor, MatchWalker, Walker
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Attributes inherited from Atomy::Pattern
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(node) ⇒ QuasiQuote
constructor
A new instance of QuasiQuote.
- #matches?(val) ⇒ Boolean
Methods inherited from Atomy::Pattern
#===, #inline_matches?, #target
Constructor Details
#initialize(node) ⇒ QuasiQuote
Returns a new instance of QuasiQuote.
20 21 22 |
# File 'lib/atomy/pattern/quasi_quote.rb', line 20 def initialize(node) @node = node end |
Instance Attribute Details
#node ⇒ Object (readonly)
Returns the value of attribute node.
9 10 11 |
# File 'lib/atomy/pattern/quasi_quote.rb', line 9 def node @node end |
Class Method Details
.make(mod, node) ⇒ Object
16 17 18 |
# File 'lib/atomy/pattern/quasi_quote.rb', line 16 def self.make(mod, node) new(mod.evaluate(patterns_through(mod, node))) end |
.patterns_through(mod, node) ⇒ Object
11 12 13 14 |
# File 'lib/atomy/pattern/quasi_quote.rb', line 11 def self.patterns_through(mod, node) constructor = Constructor.new(mod) constructor.go(node) end |
Instance Method Details
#matches?(val) ⇒ Boolean
24 25 26 |
# File 'lib/atomy/pattern/quasi_quote.rb', line 24 def matches?(val) MatchWalker.new.go(@node, val) end |