module Hefted::Refine

Public Instance Methods

indexer!(*keys) click to toggle source
# File lib/hefted/refine.rb, line 4
def indexer!(*keys)
  idx = keys.map do |key|
    value = self[key].to_i if self.key?(key)
    value ||= 0
    [key, value]
  end
  self.delete_if { |key, _| keys.include?(key) }
  idx.to_h
end
to_camel() click to toggle source
# File lib/hefted/refine.rb, line 16
def to_camel
  self.gsub(/(?:^|_|\s)(.)/) { $1.upcase }
end