Module: SendgridWeb::Request
- Extended by:
- URL
- Defined in:
- lib/sendgrid_web/request.rb
Class Attribute Summary collapse
-
.callbacks ⇒ Object
Returns the value of attribute callbacks.
-
.headers ⇒ Object
Returns the value of attribute headers.
-
.options ⇒ Object
Returns the value of attribute options.
Attributes included from URL
#format, #params, #resource, #url, #verb
Class Method Summary collapse
-
.configure {|_self| ... } ⇒ Object
Configure a Request.
- .header(header) ⇒ Object
- .option(option) ⇒ Object
Methods included from URL
Class Attribute Details
.callbacks ⇒ Object
Returns the value of attribute callbacks.
14 15 16 |
# File 'lib/sendgrid_web/request.rb', line 14 def callbacks @callbacks end |
.headers ⇒ Object
Returns the value of attribute headers.
14 15 16 |
# File 'lib/sendgrid_web/request.rb', line 14 def headers @headers end |
.options ⇒ Object
Returns the value of attribute options.
14 15 16 |
# File 'lib/sendgrid_web/request.rb', line 14 def @options end |
Class Method Details
.configure {|_self| ... } ⇒ Object
Configure a Request. @options and @headers are passed through to Faraday.
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/sendgrid_web/request.rb', line 22 def configure &block @callbacks = {} @headers = [] @options = [] unless SendgridWeb.api_user.nil? or SendgridWeb.api_key.nil? param(:api_user => SendgridWeb.api_user) param(:api_key => SendgridWeb.api_key) end yield self end |
.header(header) ⇒ Object
40 41 42 43 |
# File 'lib/sendgrid_web/request.rb', line 40 def header(header) @headers ||= {} @headers.merge!(header) end |
.option(option) ⇒ Object
35 36 37 38 |
# File 'lib/sendgrid_web/request.rb', line 35 def option(option) @options ||= {} @options.merge!(option) end |