Class: SugarCRM::Request
- Inherits:
-
Object
- Object
- SugarCRM::Request
- Defined in:
- lib/sugarcrm/connection/request.rb
Instance Attribute Summary collapse
-
#http_method ⇒ Object
readonly
Returns the value of attribute http_method.
-
#json ⇒ Object
Returns the value of attribute json.
-
#method ⇒ Object
Returns the value of attribute method.
-
#request ⇒ Object
Returns the value of attribute request.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #bytesize ⇒ Object
-
#initialize(url, method, json, debug = false) ⇒ Request
constructor
A new instance of Request.
- #length ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(url, method, json, debug = false) ⇒ Request
Returns a new instance of Request.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/sugarcrm/connection/request.rb', line 8 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 |
Instance Attribute Details
#http_method ⇒ Object (readonly)
Returns the value of attribute http_method.
6 7 8 |
# File 'lib/sugarcrm/connection/request.rb', line 6 def http_method @http_method end |
#json ⇒ Object
Returns the value of attribute json.
5 6 7 |
# File 'lib/sugarcrm/connection/request.rb', line 5 def json @json end |
#method ⇒ Object
Returns the value of attribute method.
4 5 6 |
# File 'lib/sugarcrm/connection/request.rb', line 4 def method @method end |
#request ⇒ Object
Returns the value of attribute request.
2 3 4 |
# File 'lib/sugarcrm/connection/request.rb', line 2 def request @request end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/sugarcrm/connection/request.rb', line 3 def url @url end |
Instance Method Details
#bytesize ⇒ Object
24 25 26 |
# File 'lib/sugarcrm/connection/request.rb', line 24 def bytesize self.to_s.bytesize end |
#length ⇒ Object
28 29 30 |
# File 'lib/sugarcrm/connection/request.rb', line 28 def length self.to_s.length end |
#to_s ⇒ Object
32 33 34 |
# File 'lib/sugarcrm/connection/request.rb', line 32 def to_s @request end |