Class: Mock::Bandwidth::WebhookClient
- Inherits:
-
Object
- Object
- Mock::Bandwidth::WebhookClient
- Defined in:
- lib/mock/bandwidth/webhook_client.rb
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url:, params: nil, headers: {}) ⇒ WebhookClient
constructor
A new instance of WebhookClient.
- #post ⇒ Object
Constructor Details
#initialize(url:, params: nil, headers: {}) ⇒ WebhookClient
Returns a new instance of WebhookClient.
8 9 10 11 12 |
# File 'lib/mock/bandwidth/webhook_client.rb', line 8 def initialize(url:, params: nil, headers: {}) @url = url @params = params @headers = headers end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
6 7 8 |
# File 'lib/mock/bandwidth/webhook_client.rb', line 6 def headers @headers end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
6 7 8 |
# File 'lib/mock/bandwidth/webhook_client.rb', line 6 def params @params end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/mock/bandwidth/webhook_client.rb', line 6 def url @url end |
Instance Method Details
#post ⇒ Object
14 15 16 17 18 |
# File 'lib/mock/bandwidth/webhook_client.rb', line 14 def post arguments = { body: params, headers: headers } ::HTTParty.post(url, **arguments) end |