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.
19460 19461 19462 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19460 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
19458 19459 19460 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19458 def value @value end |
Class Method Details
.ALL ⇒ Object
19480 19481 19482 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19480 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
19465 19466 19467 19468 19469 19470 19471 19472 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19465 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
19485 19486 19487 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19485 def ShopifyGrant.customer @@_customer ||= ShopifyGrant.new('customer') end |
.discount ⇒ Object
Access to /admin/price_rules/:id/discount_codes.json
19490 19491 19492 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19490 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
19475 19476 19477 19478 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19475 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
19495 19496 19497 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19495 def ShopifyGrant.gift_card @@_gift_card ||= ShopifyGrant.new('gift_card') end |
.metafield ⇒ Object
Access to /admin/variants/:id/metafields.json
19500 19501 19502 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19500 def ShopifyGrant. @@_metafield ||= ShopifyGrant.new('metafield') end |
.order ⇒ Object
Access to /admin/orders/:id/metafields.json
19505 19506 19507 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19505 def ShopifyGrant.order @@_order ||= ShopifyGrant.new('order') end |
Instance Method Details
#to_hash ⇒ Object
19509 19510 19511 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19509 def to_hash value end |