class HashMath::Unpivot::Pivot
A single pivot definition consists of which columns to coalesce and to where.
Attributes
coalesce_key[R]
coalesce_key_value[R]
keys[R]
Public Class Methods
new(keys:, coalesce_key:, coalesce_key_value:)
click to toggle source
keys is an array of keys to include in the un-pivoting. coalesce_key
is the new key to use. coalesce_key_value
is the new key to use for its corresponding values.
# File lib/hash_math/unpivot/pivot.rb, line 23 def initialize(keys:, coalesce_key:, coalesce_key_value:) @keys = Array(keys) @coalesce_key = coalesce_key @coalesce_key_value = coalesce_key_value freeze end