Class: ShopifyAPI::Metafield
- Inherits:
-
Base
- Object
- ActiveResource::Base
- Base
- ShopifyAPI::Metafield
- Includes:
- DisablePrefixCheck
- 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 inherited from Base
activate_session, clear_session, headers, #persisted?
Methods included from Countable
Methods inherited from ActiveResource::Base
build, delete, #encode, headers
Class Method Details
.prefix(options = {}) ⇒ Object
Hack to allow both Shop and other Metafields in through the same AR class
8 9 10 |
# File 'lib/shopify_api/resources/metafield.rb', line 8 def self.prefix(={}) [:resource].nil? ? "/admin/" : "/admin/#{[:resource]}/#{[:resource_id]}/" end |
Instance Method Details
#value ⇒ Object
12 13 14 15 |
# File 'lib/shopify_api/resources/metafield.rb', line 12 def value return if attributes["value"].nil? attributes["value_type"] == "integer" ? attributes["value"].to_i : attributes["value"] end |