Sha256: 25ab09f129bc176ce7ca9ee2ef56458828ca47860c7eee3ff1e6787c122bb083

Contents?: true

Size: 845 Bytes

Versions: 12

Compression:

Stored size: 845 Bytes

Contents

module Conekta
  module Operations
    module Where

      def self.handle_type_of_paging(response, class_name, params)
        if response.kind_of?(Hash) && response["object"] == "list"
          List.new(class_name, params)
        else
          ConektaObject.new
        end
      end

      module ClassMethods
        def where(params=nil)
          _url = Util.types[self.class_name.downcase]._url
          response = Requestor.new.request(:get, _url, params)
          instance = ::Conekta::Operations::Where.handle_type_of_paging(response, self.class_name, params)
          instance.load_from(response)
          instance
        end

        # <b>DEPRECATED:</b> Please use <tt>where</tt> instead.
        alias_method :all, :where
      end
      def self.included(base)
        base.extend(ClassMethods)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
conekta-2.6.0 lib/conekta/operations/where.rb
conekta-tiempometa-2.4.2 lib/conekta/operations/where.rb
conekta-2.5.0 lib/conekta/operations/where.rb
conekta-2.4.2 lib/conekta/operations/where.rb
conekta-2.4.1 lib/conekta/operations/where.rb
conekta-2.4.0 lib/conekta/operations/where.rb
conekta-2.3.0 lib/conekta/operations/where.rb
conekta-2.0.0 lib/conekta/operations/where.rb
conekta-1.1.3 lib/conekta/operations/where.rb
conekta-1.1.2 lib/conekta/operations/where.rb
conekta-1.1.1 lib/conekta/operations/where.rb
conekta-1.1.0 lib/conekta/operations/where.rb