Class: Io::Flow::V0::Clients::PriceRules

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ PriceRules

Returns a new instance of PriceRules.



7301
7302
7303
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7301

def initialize(client)
  @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
end

Instance Method Details

#get(organization, code) ⇒ Object



7305
7306
7307
7308
7309
7310
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7305

def get(organization, code)
  HttpClient::Preconditions.assert_class('organization', organization, String)
  HttpClient::Preconditions.assert_class('code', code, String)
  r = @client.request("/#{CGI.escape(organization)}/shopify/price/rules/discount/#{CGI.escape(code)}").get
  ::Io::Flow::Shopify::External::V0::Models::PriceRule.new(r)
end