Method: Micro::Attributes::Diff::Changes#initialize
- Defined in:
- lib/micro/attributes/diff.rb
#initialize(from:, to:) ⇒ Changes
Returns a new instance of Changes.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/micro/attributes/diff.rb', line 12 def initialize(from:, to:) @from_class = from.class @from, @to = from, Kind::Of.(@from_class, to) @from_key, @to_key = @from_class.attributes_access == :symbol ? FROM_TO_SYM : FROM_TO_STR @differences = diff(from.attributes, to.attributes).freeze end |