Class: Wbase::WebhookAdaptor
- Inherits:
-
Object
- Object
- Wbase::WebhookAdaptor
- Defined in:
- app/controllers/wbase/stripe_webhooks_controller.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #created ⇒ Object
- #external_id ⇒ Object
-
#initialize(params) ⇒ WebhookAdaptor
constructor
A new instance of WebhookAdaptor.
- #to_h ⇒ Object
Constructor Details
#initialize(params) ⇒ WebhookAdaptor
Returns a new instance of WebhookAdaptor.
29 30 31 |
# File 'app/controllers/wbase/stripe_webhooks_controller.rb', line 29 def initialize(params) @params = params end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
27 28 29 |
# File 'app/controllers/wbase/stripe_webhooks_controller.rb', line 27 def params @params end |
Instance Method Details
#created ⇒ Object
37 38 39 |
# File 'app/controllers/wbase/stripe_webhooks_controller.rb', line 37 def created Time.at(params['created']) end |
#external_id ⇒ Object
33 34 35 |
# File 'app/controllers/wbase/stripe_webhooks_controller.rb', line 33 def external_id params['id'] end |
#to_h ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'app/controllers/wbase/stripe_webhooks_controller.rb', line 41 def to_h { external_id: external_id, object: params['object'], api_version: params['api_version'], created: created, data: params['data'], livemode: params['livemode'], pending_webhooks: params['pending_webhooks'], external_type: params['type'], external_request: params['request'] } end |