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.
28 29 30 |
# File 'app/controllers/wbase/stripe_webhooks_controller.rb', line 28 def initialize(params) @params = params end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
26 27 28 |
# File 'app/controllers/wbase/stripe_webhooks_controller.rb', line 26 def params @params end |
Instance Method Details
#created ⇒ Object
36 37 38 |
# File 'app/controllers/wbase/stripe_webhooks_controller.rb', line 36 def created Time.at(params['created']) end |
#external_id ⇒ Object
32 33 34 |
# File 'app/controllers/wbase/stripe_webhooks_controller.rb', line 32 def external_id params['id'] end |
#to_h ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'app/controllers/wbase/stripe_webhooks_controller.rb', line 40 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 |