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
51 def [](k)
52   if  (res = super).nil?
53     @noncolumn_values[k] if !@values.has_key?(k) && @noncolumn_values
54   else
55     res
56   end
57 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
61 def remove_key!(key)
62   if @noncolumn_values && @noncolumn_values.key?(key)
63     @noncolumn_values.delete(key)
64   else
65     super
66   end
67 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
71 def split_noncolumn_values
72   cols = (@values.keys - columns)
73   return self if cols.empty?
74 
75   nc = @noncolumn_values ||= {}
76   vals = @values
77   cols.each{|k| nc[k] = vals.delete(k)}
78   self
79 end