skip to Main Content

Accessing specific attribute of an object – Shopify

Hello I have the following object object = [#<ShopifyAPI::DiscountCode:0x000000000e1c78a8 @attributes={"code"=>"Disc2", "amount"=>"1.00", "type"=>"percentage"}, @prefix_options={}, @persisted=true>] How can I properly access the "code" name of that object? I have tried object[:code] and object.code but it appears I am overlooking something.

VIEW QUESTION
Back To Top
Search