Class: FastSpring::Build::LocalizedStorePrices
- Inherits:
-
Object
- Object
- FastSpring::Build::LocalizedStorePrices
- Defined in:
- lib/fastspring-saasy/build/localized_store_prices.rb
Instance Attribute Summary collapse
-
#localized_pricing ⇒ Object
readonly
Returns the value of attribute localized_pricing.
-
#products ⇒ Object
readonly
Returns the value of attribute products.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(pricing) ⇒ LocalizedStorePrices
constructor
A new instance of LocalizedStorePrices.
Constructor Details
#initialize(pricing) ⇒ LocalizedStorePrices
Returns a new instance of LocalizedStorePrices.
6 7 8 9 10 |
# File 'lib/fastspring-saasy/build/localized_store_prices.rb', line 6 def initialize(pricing) @pricing = pricing || [] @products = [] @localized_pricing = {} end |
Instance Attribute Details
#localized_pricing ⇒ Object (readonly)
Returns the value of attribute localized_pricing.
4 5 6 |
# File 'lib/fastspring-saasy/build/localized_store_prices.rb', line 4 def localized_pricing @localized_pricing end |
#products ⇒ Object (readonly)
Returns the value of attribute products.
4 5 6 |
# File 'lib/fastspring-saasy/build/localized_store_prices.rb', line 4 def products @products end |
Instance Method Details
#build ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/fastspring-saasy/build/localized_store_prices.rb', line 12 def build return if @pricing.empty? parsed = @pricing.split("\n").map { |f| f.split("=") } @localized_pricing = Hash[parsed] build_products self end |