Class: Shutterstock::Request
- Inherits:
-
Object
- Object
- Shutterstock::Request
- Defined in:
- lib/client/request.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
writeonly
:post, :get etc.
-
#content_type ⇒ Object
writeonly
:post, :get etc.
-
#method ⇒ Object
writeonly
:post, :get etc.
-
#params ⇒ Object
writeonly
:post, :get etc.
-
#path ⇒ Object
writeonly
:post, :get etc.
-
#send_authorization ⇒ Object
writeonly
:post, :get etc.
-
#success_status ⇒ Object
writeonly
:post, :get etc.
Instance Method Summary collapse
-
#initialize(&block) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(&block) ⇒ Request
Returns a new instance of Request.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/client/request.rb', line 12 def initialize(&block) @success_status = 200 @send_authorization = true @content_type = 'application/json' # Handle both forms of config: # Request.new { |r| r.method=... } # Request.new { method=... } if block_given? if block.arity == 1 yield self else instance_eval(&block) end end end |
Instance Attribute Details
#body=(value) ⇒ Object (writeonly)
:post, :get etc
4 5 6 |
# File 'lib/client/request.rb', line 4 def body=(value) @body = value end |
#content_type=(value) ⇒ Object (writeonly)
:post, :get etc
4 5 6 |
# File 'lib/client/request.rb', line 4 def content_type=(value) @content_type = value end |
#method=(value) ⇒ Object (writeonly)
:post, :get etc
4 5 6 |
# File 'lib/client/request.rb', line 4 def method=(value) @method = value end |
#params=(value) ⇒ Object (writeonly)
:post, :get etc
4 5 6 |
# File 'lib/client/request.rb', line 4 def params=(value) @params = value end |
#path=(value) ⇒ Object (writeonly)
:post, :get etc
4 5 6 |
# File 'lib/client/request.rb', line 4 def path=(value) @path = value end |
#send_authorization=(value) ⇒ Object (writeonly)
:post, :get etc
4 5 6 |
# File 'lib/client/request.rb', line 4 def (value) @send_authorization = value end |
#success_status=(value) ⇒ Object (writeonly)
:post, :get etc
4 5 6 |
# File 'lib/client/request.rb', line 4 def success_status=(value) @success_status = value end |