Class: Smerge::Rule
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#left ⇒ Object
Returns the value of attribute left.
-
#right ⇒ Object
Returns the value of attribute right.
Instance Method Summary collapse
- #call(left, right) ⇒ Object
-
#initialize(left, right, block) ⇒ Rule
constructor
A new instance of Rule.
- #match(left, right) ⇒ Object
Constructor Details
#initialize(left, right, block) ⇒ Rule
Returns a new instance of Rule.
13 14 15 16 17 |
# File 'lib/smerge/rule.rb', line 13 def initialize(left, right, block) self.left = left self.right = right self.block = block end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
11 12 13 |
# File 'lib/smerge/rule.rb', line 11 def block @block end |
#left ⇒ Object
Returns the value of attribute left.
9 10 11 |
# File 'lib/smerge/rule.rb', line 9 def left @left end |
#right ⇒ Object
Returns the value of attribute right.
10 11 12 |
# File 'lib/smerge/rule.rb', line 10 def right @right end |
Instance Method Details
#call(left, right) ⇒ Object
24 25 26 |
# File 'lib/smerge/rule.rb', line 24 def call(left, right) self.block.call(left, right) end |
#match(left, right) ⇒ Object
19 20 21 22 |
# File 'lib/smerge/rule.rb', line 19 def match(left, right) self.left.match(left) && self.right.match(right) end |