Class: Emailvision::Request
- Inherits:
-
Object
- Object
- Emailvision::Request
- Defined in:
- lib/emailvision/request.rb
Overview
Request object
This class aims to format the request for Emailvision
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
-
#http_verb ⇒ Object
readonly
Returns the value of attribute http_verb.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#server_name ⇒ Object
readonly
Returns the value of attribute server_name.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(http_verb, token, server_name, endpoint) ⇒ Request
constructor
A new instance of Request.
- #prepare(uri, parameters) ⇒ Object
Constructor Details
#initialize(http_verb, token, server_name, endpoint) ⇒ Request
Returns a new instance of Request.
19 20 21 22 23 24 |
# File 'lib/emailvision/request.rb', line 19 def initialize(http_verb, token, server_name, endpoint) @http_verb = http_verb @token = token @server_name = server_name @endpoint = endpoint end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
9 10 11 |
# File 'lib/emailvision/request.rb', line 9 def body @body end |
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
9 10 11 |
# File 'lib/emailvision/request.rb', line 9 def endpoint @endpoint end |
#http_verb ⇒ Object (readonly)
Returns the value of attribute http_verb.
9 10 11 |
# File 'lib/emailvision/request.rb', line 9 def http_verb @http_verb end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
9 10 11 |
# File 'lib/emailvision/request.rb', line 9 def parameters @parameters end |
#server_name ⇒ Object (readonly)
Returns the value of attribute server_name.
9 10 11 |
# File 'lib/emailvision/request.rb', line 9 def server_name @server_name end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
9 10 11 |
# File 'lib/emailvision/request.rb', line 9 def token @token end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
9 10 11 |
# File 'lib/emailvision/request.rb', line 9 def uri @uri end |
Instance Method Details
#prepare(uri, parameters) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/emailvision/request.rb', line 26 def prepare(uri, parameters) @uri = uri @parameters = parameters || {} @uri = prepare_uri @body = prepare_body end |