Class: Io::Flow::V0::Models::ShopifyGrant
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ShopifyGrant
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of ShopifyGrant for this value, creating a new instance for an unknown value.
-
.customer ⇒ Object
Access to /admin/customers.json.
-
.discount ⇒ Object
Access to /admin/price_rules/:id/discount_codes.json.
-
.from_string(value) ⇒ Object
Returns the instance of ShopifyGrant for this value, or nil if not found.
-
.gift_card ⇒ Object
Access to /admin/gift_cards.json.
-
.metafield ⇒ Object
Access to /admin/variants/:id/metafields.json.
-
.order ⇒ Object
Access to /admin/orders/:id/metafields.json.
Instance Method Summary collapse
-
#initialize(value) ⇒ ShopifyGrant
constructor
A new instance of ShopifyGrant.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ ShopifyGrant
Returns a new instance of ShopifyGrant.
23373 23374 23375 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23373 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
23371 23372 23373 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23371 def value @value end |
Class Method Details
.ALL ⇒ Object
23393 23394 23395 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23393 def ShopifyGrant.ALL @@all ||= [ShopifyGrant.customer, ShopifyGrant.discount, ShopifyGrant.gift_card, ShopifyGrant., ShopifyGrant.order] end |
.apply(value) ⇒ Object
Returns the instance of ShopifyGrant for this value, creating a new instance for an unknown value
23378 23379 23380 23381 23382 23383 23384 23385 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23378 def ShopifyGrant.apply(value) if value.instance_of?(ShopifyGrant) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || ShopifyGrant.new(value)) end end |
.customer ⇒ Object
Access to /admin/customers.json
23398 23399 23400 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23398 def ShopifyGrant.customer @@_customer ||= ShopifyGrant.new('customer') end |
.discount ⇒ Object
Access to /admin/price_rules/:id/discount_codes.json
23403 23404 23405 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23403 def ShopifyGrant.discount @@_discount ||= ShopifyGrant.new('discount') end |
.from_string(value) ⇒ Object
Returns the instance of ShopifyGrant for this value, or nil if not found
23388 23389 23390 23391 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23388 def ShopifyGrant.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) ShopifyGrant.ALL.find { |v| v.value == value } end |
.gift_card ⇒ Object
Access to /admin/gift_cards.json
23408 23409 23410 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23408 def ShopifyGrant.gift_card @@_gift_card ||= ShopifyGrant.new('gift_card') end |
.metafield ⇒ Object
Access to /admin/variants/:id/metafields.json
23413 23414 23415 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23413 def ShopifyGrant. ||= ShopifyGrant.new('metafield') end |
.order ⇒ Object
Access to /admin/orders/:id/metafields.json
23418 23419 23420 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23418 def ShopifyGrant.order @@_order ||= ShopifyGrant.new('order') end |
Instance Method Details
#to_hash ⇒ Object
23422 23423 23424 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23422 def to_hash value end |