module ContentfulModel
  class Query
    attr_accessor :parameters
    def initialize(reference_class, parameters=nil)
      @parameters = parameters || { 'content_type' => reference_class.content_type_id }
      @client = reference_class.client
    end

    def <<(parameters)
      @parameters.merge!(parameters)
    end

    def execute
      @client.entries(@parameters)
    end
  end
end
module ContentfulModel
  class Query
    attr_accessor :parameters
    def initialize(referenced_class, parameters=nil)
      @parameters = parameters || {}
      @client = referenced_class.send(:client)
      @referenced_class = referenced_class
    end

    def <<(parameters)
      @parameters.merge!(parameters)
    end

    def default_parameters
      { 'content_type' => @referenced_class.send(:content_type_id) }
    end

    def execute
      query = @parameters.merge!(default_parameters)
      return @client.entries(query)
    end

    def reset
      @parameters = default_parameters
    end
  end
end
Initialize Query with an empty set of params, and merge the default ones in before executing; add a reset() method which resets the parameters
Initialize Query with an empty set of params, and merge the default ones in before executing; add a reset() method which resets the parameters
