Class: Shiftable::ShiftingRecord
- Defined in:
- lib/shiftable/shifting_record.rb
Overview
Gets data to be shifted
Instance Attribute Summary
Attributes inherited from Shifting
#bang, #base, #column, #from, #result, #run_save, #shift_all_wrapper, #shift_each_wrapper, #to
Instance Method Summary collapse
- #found? ⇒ Boolean
-
#shift ⇒ Object
True, false.
Methods inherited from Shifting
Constructor Details
This class inherits a constructor from Shiftable::Shifting
Instance Method Details
#found? ⇒ Boolean
6 7 8 |
# File 'lib/shiftable/shifting_record.rb', line 6 def found? !!result end |
#shift ⇒ Object
Returns true, false.
11 12 13 14 15 16 17 18 19 |
# File 'lib/shiftable/shifting_record.rb', line 11 def shift return false unless found? result.send("#{column}=", to.id) @run_save = yield if block_given? return nil unless run_save run_save! end |