module Sequel::Plugins::SplitValues::InstanceMethods

Public Instance Methods

[](k) click to toggle source

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

Calls superclass method
   # File lib/sequel/plugins/split_values.rb
49 def [](k)
50   if  (res = super).nil?
51     @noncolumn_values[k] if !@values.has_key?(k) && @noncolumn_values
52   else
53     res
54   end
55 end
remove_key!(key) click to toggle source

Remove the key from noncolumn values if it is present there. If it is not present there, then use the default behavior of removing it from values.

Calls superclass method
   # File lib/sequel/plugins/split_values.rb
59 def remove_key!(key)
60   if @noncolumn_values && @noncolumn_values.key?(key)
61     @noncolumn_values.delete(key)
62   else
63     super
64   end
65 end
split_noncolumn_values() click to toggle source

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

   # File lib/sequel/plugins/split_values.rb
69 def split_noncolumn_values
70   cols = (@values.keys - columns)
71   return self if cols.empty?
72 
73   nc = @noncolumn_values ||= {}
74   vals = @values
75   cols.each{|k| nc[k] = vals.delete(k)}
76   self
77 end