Class: SubDiff::Sub
- Inherits:
-
Object
- Object
- SubDiff::Sub
- Defined in:
- lib/sub_diff/sub.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#differ ⇒ Object
readonly
Returns the value of attribute differ.
Instance Method Summary collapse
- #diff(*args, &block) ⇒ Object
-
#initialize(differ) ⇒ Sub
constructor
A new instance of Sub.
Constructor Details
#initialize(differ) ⇒ Sub
Returns a new instance of Sub.
5 6 7 |
# File 'lib/sub_diff/sub.rb', line 5 def initialize(differ) @differ = differ end |
Instance Attribute Details
#differ ⇒ Object (readonly)
Returns the value of attribute differ.
3 4 5 |
# File 'lib/sub_diff/sub.rb', line 3 def differ @differ end |
Instance Method Details
#diff(*args, &block) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/sub_diff/sub.rb', line 9 def diff(*args, &block) # Ruby 1.8.7 does not support additional args after * (splat) args.push(block) differ.each_diff(*args) do |builder, diff| process(builder, diff, args.first) end end |