Class: SuperDiff::OperationTrees::DefaultObject
- Defined in:
- lib/super_diff/operation_trees/default_object.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#underlying_object ⇒ Object
readonly
Returns the value of attribute underlying_object.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(operations, underlying_object:) ⇒ DefaultObject
constructor
A new instance of DefaultObject.
- #pretty_print(pp) ⇒ Object
Methods inherited from Base
#flatten, #perhaps_elide, #to_diff
Constructor Details
#initialize(operations, underlying_object:) ⇒ DefaultObject
Returns a new instance of DefaultObject.
10 11 12 13 |
# File 'lib/super_diff/operation_trees/default_object.rb', line 10 def initialize(operations, underlying_object:) super(operations) @underlying_object = end |
Instance Attribute Details
#underlying_object ⇒ Object (readonly)
Returns the value of attribute underlying_object.
8 9 10 |
# File 'lib/super_diff/operation_trees/default_object.rb', line 8 def @underlying_object end |
Class Method Details
.applies_to? ⇒ Boolean
4 5 6 |
# File 'lib/super_diff/operation_trees/default_object.rb', line 4 def self.applies_to?(*) true end |
Instance Method Details
#pretty_print(pp) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/super_diff/operation_trees/default_object.rb', line 15 def pretty_print(pp) pp.text "#<#{self.class.name} " pp.nest(1) do pp.breakable pp.text ":operations=>" pp.group(1, "[", "]") do pp.breakable pp.seplist(self) { |value| pp.pp value } end pp.comma_breakable pp.text ":underlying_object=>" pp.object_address_group do # do nothing end end pp.text ">" end |