Class: One::Pivot
- Inherits:
-
Object
- Object
- One::Pivot
- Defined in:
- lib/one/pivot.rb
Overview
Simple class to hold meta information about a pivot. This class was created to support invoking One::Pivot#multi_pivot with identifiers for each pivot.
Instance Attribute Summary collapse
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#pivot_proc ⇒ Object
readonly
Returns the value of attribute pivot_proc.
Instance Method Summary collapse
-
#initialize(identifier) {|item| ... } ⇒ Pivot
constructor
Constructor.
Constructor Details
#initialize(identifier) {|item| ... } ⇒ Pivot
Constructor. param [String, Symbol] identifier The name of the pivot
14 15 16 17 18 |
# File 'lib/one/pivot.rb', line 14 def initialize(identifier, &block) raise LocalJumpError.new("no block given") unless block_given? @identifier = identifier @pivot_proc = block end |
Instance Attribute Details
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
6 7 8 |
# File 'lib/one/pivot.rb', line 6 def identifier @identifier end |
#pivot_proc ⇒ Object (readonly)
Returns the value of attribute pivot_proc.
7 8 9 |
# File 'lib/one/pivot.rb', line 7 def pivot_proc @pivot_proc end |