Class: ActiveRecord::WhenChange::ChangedAttributes
- Inherits:
-
Object
- Object
- ActiveRecord::WhenChange::ChangedAttributes
- Defined in:
- lib/active_record/when_change.rb
Instance Attribute Summary collapse
-
#attr ⇒ Object
readonly
Returns the value of attribute attr.
-
#current ⇒ Object
readonly
Returns the value of attribute current.
-
#old_attr ⇒ Object
readonly
Returns the value of attribute old_attr.
Instance Method Summary collapse
-
#initialize(attr, old_attr, current) ⇒ ChangedAttributes
constructor
A new instance of ChangedAttributes.
- #inspect ⇒ Object
- #new_value ⇒ Object
- #old ⇒ Object
- #old_value ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(attr, old_attr, current) ⇒ ChangedAttributes
Returns a new instance of ChangedAttributes.
45 46 47 48 49 |
# File 'lib/active_record/when_change.rb', line 45 def initialize attr, old_attr, current @attr = attr @old_attr = old_attr @current = current end |
Instance Attribute Details
#attr ⇒ Object (readonly)
Returns the value of attribute attr.
44 45 46 |
# File 'lib/active_record/when_change.rb', line 44 def attr @attr end |
#current ⇒ Object (readonly)
Returns the value of attribute current.
44 45 46 |
# File 'lib/active_record/when_change.rb', line 44 def current @current end |
#old_attr ⇒ Object (readonly)
Returns the value of attribute old_attr.
44 45 46 |
# File 'lib/active_record/when_change.rb', line 44 def old_attr @old_attr end |
Instance Method Details
#inspect ⇒ Object
51 52 53 |
# File 'lib/active_record/when_change.rb', line 51 def inspect old != value end |
#new_value ⇒ Object
67 68 69 |
# File 'lib/active_record/when_change.rb', line 67 def new_value value end |
#old ⇒ Object
55 56 57 |
# File 'lib/active_record/when_change.rb', line 55 def old old_attr[attr] end |
#old_value ⇒ Object
63 64 65 |
# File 'lib/active_record/when_change.rb', line 63 def old_value old end |
#value ⇒ Object
59 60 61 |
# File 'lib/active_record/when_change.rb', line 59 def value current.read_attribute attr end |