Class: Gorillapi::RequestBuilder
- Inherits:
-
Object
- Object
- Gorillapi::RequestBuilder
- Includes:
- CurlBuilder
- Defined in:
- lib/gorillapi/request_builder.rb
Instance Attribute Summary collapse
-
#accept_header ⇒ Object
readonly
Returns the value of attribute accept_header.
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#request_method ⇒ Object
readonly
Returns the value of attribute request_method.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ RequestBuilder
constructor
A new instance of RequestBuilder.
- #print ⇒ Object
- #send ⇒ Object
Methods included from CurlBuilder
#accept, #add_params, #authorization, #content_header, #host, #request_string
Constructor Details
#initialize(options = {}) ⇒ RequestBuilder
Returns a new instance of RequestBuilder.
7 8 9 10 11 |
# File 'lib/gorillapi/request_builder.rb', line 7 def initialize( = {}) .each do |key, value| instance_variable_set("@#{key}", value) unless value.nil? || value.empty? end end |
Instance Attribute Details
#accept_header ⇒ Object (readonly)
Returns the value of attribute accept_header.
5 6 7 |
# File 'lib/gorillapi/request_builder.rb', line 5 def accept_header @accept_header end |
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
5 6 7 |
# File 'lib/gorillapi/request_builder.rb', line 5 def content_type @content_type end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
5 6 7 |
# File 'lib/gorillapi/request_builder.rb', line 5 def params @params end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/gorillapi/request_builder.rb', line 5 def path @path end |
#request_method ⇒ Object (readonly)
Returns the value of attribute request_method.
5 6 7 |
# File 'lib/gorillapi/request_builder.rb', line 5 def request_method @request_method end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
5 6 7 |
# File 'lib/gorillapi/request_builder.rb', line 5 def token @token end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/gorillapi/request_builder.rb', line 5 def url @url end |
Instance Method Details
#print ⇒ Object
17 18 19 |
# File 'lib/gorillapi/request_builder.rb', line 17 def print request_string end |
#send ⇒ Object
13 14 15 |
# File 'lib/gorillapi/request_builder.rb', line 13 def send `#{request_string}` end |