Class: PaddleConfig
- Inherits:
-
Object
- Object
- PaddleConfig
- Defined in:
- lib/motion-paddle/paddle.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#current_price ⇒ Object
Returns the value of attribute current_price.
-
#dev_name ⇒ Object
Returns the value of attribute dev_name.
-
#image ⇒ Object
Returns the value of attribute image.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#product_id ⇒ Object
Returns the value of attribute product_id.
-
#product_image ⇒ Object
Returns the value of attribute product_image.
-
#product_name ⇒ Object
Returns the value of attribute product_name.
-
#store ⇒ Object
Returns the value of attribute store.
-
#time_trial ⇒ Object
Returns the value of attribute time_trial.
-
#trial_duration ⇒ Object
Returns the value of attribute trial_duration.
-
#trial_text ⇒ Object
Returns the value of attribute trial_text.
-
#vendor_id ⇒ Object
Returns the value of attribute vendor_id.
Instance Method Summary collapse
-
#initialize(config, options) ⇒ PaddleConfig
constructor
A new instance of PaddleConfig.
- #inspect ⇒ Object
- #mas_store? ⇒ Boolean
- #paddle_store? ⇒ Boolean
- #set(var, val) ⇒ Object
Constructor Details
#initialize(config, options) ⇒ PaddleConfig
Returns a new instance of PaddleConfig.
10 11 12 13 |
# File 'lib/motion-paddle/paddle.rb', line 10 def initialize(config, ) @config = config = end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
7 8 9 |
# File 'lib/motion-paddle/paddle.rb', line 7 def api_key @api_key end |
#currency ⇒ Object
Returns the value of attribute currency.
7 8 9 |
# File 'lib/motion-paddle/paddle.rb', line 7 def currency @currency end |
#current_price ⇒ Object
Returns the value of attribute current_price.
7 8 9 |
# File 'lib/motion-paddle/paddle.rb', line 7 def current_price @current_price end |
#dev_name ⇒ Object
Returns the value of attribute dev_name.
7 8 9 |
# File 'lib/motion-paddle/paddle.rb', line 7 def dev_name @dev_name end |
#image ⇒ Object
Returns the value of attribute image.
7 8 9 |
# File 'lib/motion-paddle/paddle.rb', line 7 def image @image end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/motion-paddle/paddle.rb', line 6 def end |
#product_id ⇒ Object
Returns the value of attribute product_id.
7 8 9 |
# File 'lib/motion-paddle/paddle.rb', line 7 def product_id @product_id end |
#product_image ⇒ Object
Returns the value of attribute product_image.
7 8 9 |
# File 'lib/motion-paddle/paddle.rb', line 7 def product_image @product_image end |
#product_name ⇒ Object
Returns the value of attribute product_name.
7 8 9 |
# File 'lib/motion-paddle/paddle.rb', line 7 def product_name @product_name end |
#store ⇒ Object
Returns the value of attribute store.
7 8 9 |
# File 'lib/motion-paddle/paddle.rb', line 7 def store @store end |
#time_trial ⇒ Object
Returns the value of attribute time_trial.
7 8 9 |
# File 'lib/motion-paddle/paddle.rb', line 7 def time_trial @time_trial end |
#trial_duration ⇒ Object
Returns the value of attribute trial_duration.
7 8 9 |
# File 'lib/motion-paddle/paddle.rb', line 7 def trial_duration @trial_duration end |
#trial_text ⇒ Object
Returns the value of attribute trial_text.
7 8 9 |
# File 'lib/motion-paddle/paddle.rb', line 7 def trial_text @trial_text end |
#vendor_id ⇒ Object
Returns the value of attribute vendor_id.
7 8 9 |
# File 'lib/motion-paddle/paddle.rb', line 7 def vendor_id @vendor_id end |
Instance Method Details
#inspect ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/motion-paddle/paddle.rb', line 29 def inspect { product_id: product_id, vendor_id: vendor_id, api_key: api_key, current_price: current_price, dev_name: dev_name, currency: currency, image: image, product_name: product_name, trial_duration: trial_duration, trial_text: trial_text, product_image: product_image, time_trial: time_trial, store: store }.inspect end |
#mas_store? ⇒ Boolean
15 16 17 |
# File 'lib/motion-paddle/paddle.rb', line 15 def mas_store? [:force_mas] || ENV.fetch('store', 'paddle').downcase == 'mas' end |
#paddle_store? ⇒ Boolean
19 20 21 |
# File 'lib/motion-paddle/paddle.rb', line 19 def paddle_store? ![:force_mas] && ENV.fetch('store', 'paddle').downcase == 'paddle' end |
#set(var, val) ⇒ Object
23 24 25 26 27 |
# File 'lib/motion-paddle/paddle.rb', line 23 def set(var, val) @config.info_plist["MotionPaddle_#{@config.short_version}"] ||= [{}] @config.info_plist["MotionPaddle_#{@config.short_version}"].first[var.to_s] = val send("#{var}=", val) end |