Class: ShopifyAPI::Metafield
- Defined in:
- lib/shopify_api.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
Class Method Details
.prefix(options = {}) ⇒ Object
Hack to allow both Shop and other Metafields in through the same AR class
354 355 356 |
# File 'lib/shopify_api.rb', line 354 def self.prefix(={}) [:resource].nil? ? "/admin/" : "/admin/#{[:resource]}/#{[:resource_id]}/" end |
Instance Method Details
#value ⇒ Object
358 359 360 361 |
# File 'lib/shopify_api.rb', line 358 def value return if attributes["value"].nil? attributes["value_type"] == "integer" ? attributes["value"].to_i : attributes["value"] end |