Class: VcrStripeWebhook::Event
- Inherits:
-
Object
- Object
- VcrStripeWebhook::Event
- Defined in:
- lib/vcr_stripe_webhook/event.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #as_hash ⇒ Object
- #as_json ⇒ Object
-
#initialize(type, event_hash) ⇒ Event
constructor
A new instance of Event.
- #to_h ⇒ Object
Constructor Details
#initialize(type, event_hash) ⇒ Event
Returns a new instance of Event.
7 8 9 10 |
# File 'lib/vcr_stripe_webhook/event.rb', line 7 def initialize(type, event_hash) @type = type @event_hash = event_hash end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/vcr_stripe_webhook/event.rb', line 5 def type @type end |
Class Method Details
Instance Method Details
#as_hash ⇒ Object
19 20 21 |
# File 'lib/vcr_stripe_webhook/event.rb', line 19 def as_hash @event_hash end |
#as_json ⇒ Object
23 24 25 |
# File 'lib/vcr_stripe_webhook/event.rb', line 23 def as_json @json = JSON.generate(@event_hash) end |
#to_h ⇒ Object
12 13 14 15 16 17 |
# File 'lib/vcr_stripe_webhook/event.rb', line 12 def to_h { "type" => type, "value" => as_hash } end |