Class: Furnace::AST::MatcherSpecial
- Inherits:
-
Object
- Object
- Furnace::AST::MatcherSpecial
- Defined in:
- lib/furnace/ast/matcher/special.rb
Instance Attribute Summary collapse
-
#param ⇒ Object
readonly
Returns the value of attribute param.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type, param = nil) ⇒ MatcherSpecial
constructor
A new instance of MatcherSpecial.
Constructor Details
#initialize(type, param = nil) ⇒ MatcherSpecial
Returns a new instance of MatcherSpecial.
5 6 7 |
# File 'lib/furnace/ast/matcher/special.rb', line 5 def initialize(type, param=nil) @type, @param = type, param end |
Instance Attribute Details
#param ⇒ Object (readonly)
Returns the value of attribute param.
3 4 5 |
# File 'lib/furnace/ast/matcher/special.rb', line 3 def param @param end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/furnace/ast/matcher/special.rb', line 3 def type @type end |
Class Method Details
.define(type) ⇒ Object
10 11 12 |
# File 'lib/furnace/ast/matcher/special.rb', line 10 def define(type) lambda { |*args| new(type, args) } end |
.kind(type) ⇒ Object
14 15 16 17 |
# File 'lib/furnace/ast/matcher/special.rb', line 14 def kind(type) @kind_lambdas ||= {} @kind_lambdas[type] ||= lambda { |m| m.is_a?(MatcherSpecial) && m.type == type } end |