Module: Sequel::Plugins::SplitValues::InstanceMethods

Defined in:
lib/sequel/plugins/split_values.rb

Instance Method Summary collapse

Instance Method Details

#[](k) ⇒ Object

If there isn’t an entry in the values hash, but there is a noncolumn_values hash, look in that hash for the value.



47
48
49
# File 'lib/sequel/plugins/split_values.rb', line 47

def [](k)
  super || (@noncolumn_values[k] if !@values.has_key?(k) && @noncolumn_values)
end

#split_noncolumn_valuesObject

Check all entries in the values hash. If any of the keys are not columns, move the entry into the noncolumn_values hash.



53
54
55
56
57
58
59
60
# File 'lib/sequel/plugins/split_values.rb', line 53

def split_noncolumn_values
  @values.keys.each do |k|
    unless columns.include?(k)
      (@noncolumn_values ||= {})[k] = @values.delete(k)
    end
  end
  self
end