Sha256: 92ffc3dd216288950ca2aa89e505fd214b5ad8dfc1f99eb100b695d1114b3dec

Contents?: true

Size: 599 Bytes

Versions: 8

Compression:

Stored size: 599 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     = json
    @request  = 'method=' << @method.to_s
    @request << '&input_type=JSON'
    @request << '&response_type=JSON'
    @request << '&rest_data=' << @json
    if debug
      puts "#{method}: Request:"
      pp @request 
      puts "\n"
    end
    self
  end
  
  def length
    self.to_s.length
  end
  
  def to_s
    URI.escape(@request)
  end
end; end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sugarcrm-0.9.7 lib/sugarcrm/connection/request.rb
sugarcrm-0.9.6 lib/sugarcrm/connection/request.rb
sugarcrm-0.9.5 lib/sugarcrm/connection/request.rb
sugarcrm-0.9.4 lib/sugarcrm/connection/request.rb
sugarcrm-0.9.3 lib/sugarcrm/connection/request.rb
sugarcrm-0.9.2 lib/sugarcrm/connection/request.rb
sugarcrm-0.9.1 lib/sugarcrm/connection/request.rb
sugarcrm-0.9.0 lib/sugarcrm/connection/request.rb