Class: Crimson::ModelChange

Inherits:
Object
  • Object
show all
Defined in:
lib/crimson/model_change.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(old_value, new_value) ⇒ ModelChange

Returns a new instance of ModelChange.



7
8
9
10
# File 'lib/crimson/model_change.rb', line 7

def initialize(old_value, new_value)
  @old_value = old_value
  @new_value = new_value
end

Instance Attribute Details

#new_valueObject (readonly)

Returns the value of attribute new_value.



5
6
7
# File 'lib/crimson/model_change.rb', line 5

def new_value
  @new_value
end

#old_valueObject (readonly)

Returns the value of attribute old_value.



5
6
7
# File 'lib/crimson/model_change.rb', line 5

def old_value
  @old_value
end

Instance Method Details

#inspectObject



12
13
14
# File 'lib/crimson/model_change.rb', line 12

def inspect
  to_s
end

#to_sObject



16
17
18
# File 'lib/crimson/model_change.rb', line 16

def to_s
  return "<#{old_value.inspect}, #{new_value.inspect}>"
end