Module: DirtyValidAttr::InstanceMethods
- Defined in:
- lib/zuora/models/dirty.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#changed_attributes ⇒ Object
Returns the value of attribute changed_attributes.
Instance Method Summary collapse
- #coerce_value(coerce, value) ⇒ Object
- #fail_type!(attr, value, type) ⇒ Object
- #fail_validation!(attr, value) ⇒ Object
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
43 44 45 |
# File 'lib/zuora/models/dirty.rb', line 43 def attributes @attributes end |
#changed_attributes ⇒ Object
Returns the value of attribute changed_attributes.
42 43 44 |
# File 'lib/zuora/models/dirty.rb', line 42 def changed_attributes @changed_attributes end |
Instance Method Details
#coerce_value(coerce, value) ⇒ Object
57 58 59 60 61 |
# File 'lib/zuora/models/dirty.rb', line 57 def coerce_value(coerce, value) return coerce.call(value) rescue throw "Unable to coerce #{value}" end |
#fail_type!(attr, value, type) ⇒ Object
50 51 52 53 54 55 |
# File 'lib/zuora/models/dirty.rb', line 50 def fail_type!(attr, value, type) fail %(Invalid type for: attr: #{attr} - value: #{value} - is: #{value.class} - should be: #{type}) end |
#fail_validation!(attr, value) ⇒ Object
45 46 47 48 |
# File 'lib/zuora/models/dirty.rb', line 45 def fail_validation!(attr, value) = "Invalid value for: attr: #{attr} - value: #{value}}" fail end |