Class: ShopifyAPI::Metafield
- Inherits:
-
Base
- Object
- ActiveResource::Base
- Base
- ShopifyAPI::Metafield
- Defined in:
- lib/shopify_api/resources/metafield.rb
Class Method Summary collapse
-
.prefix(options = {}) ⇒ Object
Hack to allow both Shop and other Metafields in through the same AR class.
Instance Method Summary collapse
Methods included from Countable
Methods inherited from ActiveResource::Base
Class Method Details
.prefix(options = {}) ⇒ Object
Hack to allow both Shop and other Metafields in through the same AR class
6 7 8 |
# File 'lib/shopify_api/resources/metafield.rb', line 6 def self.prefix(={}) [:resource].nil? ? "/admin/" : "/admin/#{[:resource]}/#{[:resource_id]}/" end |
Instance Method Details
#value ⇒ Object
10 11 12 13 |
# File 'lib/shopify_api/resources/metafield.rb', line 10 def value return if attributes["value"].nil? attributes["value_type"] == "integer" ? attributes["value"].to_i : attributes["value"] end |