Class: Resty::Request
- Inherits:
-
Object
- Object
- Resty::Request
- Defined in:
- lib/resty/request.rb
Instance Attribute Summary collapse
-
#global_options ⇒ Object
readonly
Returns the value of attribute global_options.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(global_options, params) ⇒ Request
constructor
A new instance of Request.
- #send_request(options = {}) ⇒ Object
Constructor Details
#initialize(global_options, params) ⇒ Request
Returns a new instance of Request.
8 9 10 11 |
# File 'lib/resty/request.rb', line 8 def initialize(, params) @global_options = @params = params end |
Instance Attribute Details
#global_options ⇒ Object (readonly)
Returns the value of attribute global_options.
6 7 8 |
# File 'lib/resty/request.rb', line 6 def @global_options end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
6 7 8 |
# File 'lib/resty/request.rb', line 6 def params @params end |
Class Method Details
.data_required?(method) ⇒ Boolean
18 19 20 |
# File 'lib/resty/request.rb', line 18 def self.data_required?(method) (method =~ %r{put|post|patch}) == 0 end |
Instance Method Details
#send_request(options = {}) ⇒ Object
13 14 15 16 |
# File 'lib/resty/request.rb', line 13 def send_request( = {}) [:headers].merge!([:headers]) if [:headers] RestClient::Request.new().execute { |*params| yield params } end |