lib/flapjack-diner/tools.rb
# used for the JSON data hashes in POST, PUT, DELETE
used for the JSON data hashes in POST, PUT, DELETE
used for the JSON data hashes in POST PUT DELETE
def prepare_nested_query(value)
        if value.respond_to?(:iso8601)
          value.iso8601
        else
          case value
          when Array
            value.map { |v| prepare_nested_query(v) }
          when Hash
            value.inject({}) do |memo, (k, v)|
              memo[k] = prepare_nested_query(v)
              memo
            end
          when Integer, TrueClass, FalseClass, NilClass
            value
          else
            value.to_s
          end
        end
      end
def prepare_nested_query ( value ) if value . respond_to? ( :iso8601 ) value . iso8601 else case value when Array value . map { | v | prepare_nested_query ( v ) } when Hash value . inject ( { } ) do | memo , ( k , v ) | memo [ k ] = prepare_nested_query ( v ) memo end when Integer , TrueClass , FalseClass , NilClass value else value . to_s end end end
used for the JSON data hashes in POST, PUT, DELETE
used for the JSON data hashes in POST PUT DELETE
value