Closed eni9889 closed 10 months ago
There's a seeminglyl useful from_hash: argument in ShopifyAPI::Rest::Base#initialize, but it's not usable because all subclasses override #initialize.
from_hash:
ShopifyAPI::Rest::Base#initialize
#initialize
# base.rb def initialize(session: nil, from_hash: nil) # elided code from_hash&.each do |key, value| set_property(key, value) end end
# asset.rb def initialize(session: ShopifyAPI::Context.active_session) super(session: session) # elided code end
Initialize a ShopifyAPI::Rest::* object with #new(from_hash: my_hash)
ShopifyAPI::Rest::*
#new(from_hash: my_hash)
ArgumentError: unknown keyword: :from_hash
shopify_api
13.2.0
2023-10
Up! this function is still featured quite prominently in the latest version of doc: https://github.com/Shopify/shopify-api-ruby/blob/6c2a45f8377ac46217f9dd24068667ccd2a4ee5c/docs/usage/rest.md?plain=1#L51
Issue summary
There's a seeminglyl useful
from_hash:
argument inShopifyAPI::Rest::Base#initialize
, but it's not usable because all subclasses override#initialize
.Expected behavior
Initialize a
ShopifyAPI::Rest::*
object with#new(from_hash: my_hash)
Actual behavior
Steps to reproduce the problem
Specifications
shopify_api
version:13.2.0
2023-10
):