Class: Patm::Rule::Compiled
- Inherits:
-
Object
- Object
- Patm::Rule::Compiled
- Defined in:
- lib/patm.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#src_body ⇒ Object
readonly
Returns the value of attribute src_body.
Instance Method Summary collapse
-
#initialize(src_body, context) ⇒ Compiled
constructor
A new instance of Compiled.
Constructor Details
#initialize(src_body, context) ⇒ Compiled
Returns a new instance of Compiled.
607 608 609 610 611 612 613 614 615 616 617 618 619 620 |
# File 'lib/patm.rb', line 607 def initialize(src_body, context) @src_body = src_body @context = context @src = <<-RUBY def apply(_obj, _self = nil) _ctx = @context _match = {} #{@src_body} end RUBY singleton_class = class <<self; self; end singleton_class.class_eval(@src) end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
623 624 625 |
# File 'lib/patm.rb', line 623 def context @context end |
#src_body ⇒ Object (readonly)
Returns the value of attribute src_body.
622 623 624 |
# File 'lib/patm.rb', line 622 def src_body @src_body end |