Sha256: e58f4ab159dc6b68214c97f88db8de41c55a867594a157aaa6a468f07221db05

Contents?: true

Size: 837 Bytes

Versions: 4

Compression:

Stored size: 837 Bytes

Contents

module Pardot
  module Objects
    module CustomFields
      def custom_fields
        @custom_fields ||= CustomFields.new self
      end

      class CustomFields
        def initialize(client)
          @client = client
        end

        def query(params)
          result = get '/do/query', params, 'result'
          result['total_results'] = result['total_results'].to_i if result['total_results']
          result
        end

        protected

        def get(path, params = {}, result = 'customField')
          response = @client.get 'customField', path, params
          result ? response[result] : response
        end

        def post(path, params = {}, result = 'user')
          response = @client.post 'customField', path, params
          result ? response[result] : response
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-pardot-1.4.3 lib/pardot/objects/custom_fields.rb
ruby-pardot-1.4.2 lib/pardot/objects/custom_fields.rb
ruby-pardot-1.4.1 lib/pardot/objects/custom_fields.rb
ruby-pardot-1.4.0 lib/pardot/objects/custom_fields.rb