Class: Epages::WebhookResponse
- Inherits:
-
Object
- Object
- Epages::WebhookResponse
- Includes:
- Utils
- Defined in:
- lib/epages/webhook_response.rb
Constant Summary collapse
- KEYS =
%w(links content page).collect(&:to_sym).freeze
Instance Method Summary collapse
-
#initialize(data) ⇒ WebhookResponse
constructor
A new instance of WebhookResponse.
Methods included from Utils
build_shop_from, camelize_keys, camelize_words, options_to_multipart_request, options_to_patch_request, parse_attribute_as, parse_attribute_as_array_of, parse_attributes, symbolize_keys!, to_query_options, underscorize_keys
Constructor Details
#initialize(data) ⇒ WebhookResponse
Returns a new instance of WebhookResponse.
11 12 13 14 15 |
# File 'lib/epages/webhook_response.rb', line 11 def initialize(data) parse_attribute_as_array_of(:links, data.delete(:links), Epages::Link) parse_attribute_as_array_of(:content, data.delete(:content), Epages::Webhook) parse_attribute_as(:page, data.delete(:page), Epages::WebhookResponsePagination) end |