module RailsAgnosticModels::ArelTranslator::CollectionConverters
Private Instance Methods
array_value(value)
click to toggle source
# File lib/rails_agnostic_models/arel_translator/collection_converters.rb, line 18 def array_value(value) case value when String then return "\"#{value}\"" else return value end end
array_without_brackets(array)
click to toggle source
# File lib/rails_agnostic_models/arel_translator/collection_converters.rb, line 12 def array_without_brackets(array) return array.inject([]) do |a, value| a << array_value(value) end.join(", ") end
hash_without_braches(hash)
click to toggle source
# File lib/rails_agnostic_models/arel_translator/collection_converters.rb, line 6 def hash_without_braches(hash) return hash.keys.inject([]) do |a, key| a << "#{key}: #{hash[key]}" end.join(', ') end