Class: FastSpring::LocalizedStorePricing
Instance Method Summary
collapse
find, #initialize
Instance Method Details
#base_localized_store_pricing_path ⇒ Object
11
12
13
|
# File 'lib/fastspring-saasy/localized_store_pricing.rb', line 11
def base_localized_store_pricing_path
"/#{@company}/api/price"
end
|
#find ⇒ Object
Get the localized store pricing from Saasy
4
5
6
7
8
9
|
# File 'lib/fastspring-saasy/localized_store_pricing.rb', line 4
def find
@response = self.class.get(base_localized_store_pricing_path, :query => query, :parser => Parser::Txt)
self
end
|
#product_quantity(product_path) ⇒ Object
37
38
39
|
# File 'lib/fastspring-saasy/localized_store_pricing.rb', line 37
def product_quantity(product_path)
parsed_response[product_path]["quantity"]
end
|
#product_unit_currency(product_path) ⇒ Object
45
46
47
|
# File 'lib/fastspring-saasy/localized_store_pricing.rb', line 45
def product_unit_currency(product_path)
parsed_response[product_path]["unit_currency"]
end
|
#product_unit_display(product_path) ⇒ Object
49
50
51
|
# File 'lib/fastspring-saasy/localized_store_pricing.rb', line 49
def product_unit_display(product_path)
parsed_response[product_path]["unit_display"]
end
|
#product_unit_html(product_path) ⇒ Object
53
54
55
|
# File 'lib/fastspring-saasy/localized_store_pricing.rb', line 53
def product_unit_html(product_path)
parsed_response[product_path]["unit_html"]
end
|
#product_unit_value(product_path) ⇒ Object
41
42
43
|
# File 'lib/fastspring-saasy/localized_store_pricing.rb', line 41
def product_unit_value(product_path)
parsed_response[product_path]["unit_value"]
end
|
#query ⇒ Object
15
16
17
18
19
20
21
22
23
|
# File 'lib/fastspring-saasy/localized_store_pricing.rb', line 15
def query
query_hash = Hash.new
@product_paths.each_index{ |index| query_hash["product_#{(index + 1)}_path".to_sym] = @product_paths[index] }
query_hash.merge({
:user_remote_addr => @remote_ip,
:user_accept_language => @http_accept_language,
:user_x_forwarded_for => @http_x_forwarded_for
})
end
|
#user_country ⇒ Object
25
26
27
|
# File 'lib/fastspring-saasy/localized_store_pricing.rb', line 25
def user_country
parsed_response['user_country']
end
|
#user_currency ⇒ Object
33
34
35
|
# File 'lib/fastspring-saasy/localized_store_pricing.rb', line 33
def user_currency
parsed_response['user_currency']
end
|
#user_language ⇒ Object
29
30
31
|
# File 'lib/fastspring-saasy/localized_store_pricing.rb', line 29
def user_language
parsed_response['user_language']
end
|