Class: SugarCRM::Request
- Inherits:
-
Object
- Object
- SugarCRM::Request
- Defined in:
- lib/sugarcrm/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
-
#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.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/sugarcrm/request.rb', line 11 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 |
Instance Attribute Details
#http_method ⇒ Object (readonly)
Returns the value of attribute http_method.
9 10 11 |
# File 'lib/sugarcrm/request.rb', line 9 def http_method @http_method end |
#json ⇒ Object
Returns the value of attribute json.
8 9 10 |
# File 'lib/sugarcrm/request.rb', line 8 def json @json end |
#method ⇒ Object
Returns the value of attribute method.
7 8 9 |
# File 'lib/sugarcrm/request.rb', line 7 def method @method end |
#request ⇒ Object
Returns the value of attribute request.
5 6 7 |
# File 'lib/sugarcrm/request.rb', line 5 def request @request end |
#url ⇒ Object
Returns the value of attribute url.
6 7 8 |
# File 'lib/sugarcrm/request.rb', line 6 def url @url end |
Instance Method Details
#length ⇒ Object
29 30 31 |
# File 'lib/sugarcrm/request.rb', line 29 def length self.to_s.length end |
#to_s ⇒ Object
33 34 35 |
# File 'lib/sugarcrm/request.rb', line 33 def to_s URI.escape(@request) end |