Class: Lucid::Shopify::Webhook
- Inherits:
-
Object
- Object
- Lucid::Shopify::Webhook
- Extended by:
- Dry::Initializer
- Defined in:
- lib/lucid/shopify/webhook.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #as_json ⇒ Hash
- #data ⇒ String
- #data_hash ⇒ Hash (also: #to_h)
- #each(&block) ⇒ Object
- #myshopify_domain ⇒ String
- #to_json(*args) ⇒ String
- #topic ⇒ String
Instance Method Details
#[](key) ⇒ Object
34 35 36 |
# File 'lib/lucid/shopify/webhook.rb', line 34 def [](key) data_hash[key] end |
#as_json ⇒ Hash
41 42 43 |
# File 'lib/lucid/shopify/webhook.rb', line 41 def as_json(*) to_h end |
#data ⇒ String
17 |
# File 'lib/lucid/shopify/webhook.rb', line 17 param :data |
#data_hash ⇒ Hash Also known as: to_h
20 21 22 23 24 |
# File 'lib/lucid/shopify/webhook.rb', line 20 def data_hash @data_hash ||= JSON.parse(data) rescue JSON::ParserError {} end |
#each(&block) ⇒ Object
27 28 29 |
# File 'lib/lucid/shopify/webhook.rb', line 27 def each(&block) data_hash.each(&block) end |
#myshopify_domain ⇒ String
13 |
# File 'lib/lucid/shopify/webhook.rb', line 13 param :myshopify_domain |
#to_json(*args) ⇒ String
46 47 48 |
# File 'lib/lucid/shopify/webhook.rb', line 46 def to_json(*args) as_json.to_json(*args) end |
#topic ⇒ String
15 |
# File 'lib/lucid/shopify/webhook.rb', line 15 param :topic |