Method: ShopifyAPI::Asset#value
- Defined in:
- lib/shopify_api/resources/asset.rb
#value ⇒ Object
For text assets, Shopify returns the data in the ‘value’ attribute. For binary assets, the data is base-64-encoded and returned in the ‘attachment’ attribute. This accessor returns the data in both cases.
64 65 66 67 |
# File 'lib/shopify_api/resources/asset.rb', line 64 def value attributes['value'] || (attributes['attachment'] ? Base64.decode64(attributes['attachment']) : nil) end |