module Grut::Asset

Public Class Methods

contract_sql_condition(hash) click to toggle source
# File lib/grut/asset.rb, line 18
def self.contract_sql_condition(hash)
  hash.map do |key, value|
    "key = :key_#{key} and value = :val_#{value}"
  end.join(' and ')
end
sanitize_contract_hash(hash) click to toggle source
# File lib/grut/asset.rb, line 10
def self.sanitize_contract_hash(hash)
  hash.reduce({}) do |res, (key, val)|
    res[:"key_#{key}"] = key
    res[:"val_#{val}"] = val
    res
  end
end
stringify_hash(hash) click to toggle source
# File lib/grut/asset.rb, line 3
def self.stringify_hash(hash)
  hash.reduce({}) do |res, (key, val)|
    res[key.to_s] = val.to_s
    res
  end
end