Sha256: aecaa52055f12cb949b44ad69d04189855507706c5453b40979194c0a9e901ca

Contents?: true

Size: 597 Bytes

Versions: 4

Compression:

Stored size: 597 Bytes

Contents

module SugarCRM; class Request
  attr :request, true
  attr :url, true
  attr :method, true
  attr :json, true
  attr :http_method

  def initialize(url, method, json, debug=false)
    @url      = url
    @method   = method
    @json     = CGI.escape(json)
    @request  = 'method=' << @method.to_s
    @request << '&input_type=JSON'
    @request << '&response_type=JSON'
    @request << '&rest_data=' << @json
    if debug
      puts "#{method}: Request:"
      puts json 
      puts "\n"
    end
    self
  end
  
  def length
    self.to_s.length
  end
  
  def to_s
    @request
  end
end; end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sugarcrm-0.9.12 ./lib/sugarcrm/connection/request.rb
sugarcrm-0.9.11 lib/sugarcrm/connection/request.rb
sugarcrm-0.9.10 lib/sugarcrm/connection/request.rb
sugarcrm-0.9.9 lib/sugarcrm/connection/request.rb