Class: PaddleConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/motion-paddle/paddle.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ PaddleConfig

Returns a new instance of PaddleConfig.



8
9
10
# File 'lib/motion-paddle/paddle.rb', line 8

def initialize(config)
  @config = config
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



6
7
8
# File 'lib/motion-paddle/paddle.rb', line 6

def api_key
  @api_key
end

#currencyObject

Returns the value of attribute currency.



6
7
8
# File 'lib/motion-paddle/paddle.rb', line 6

def currency
  @currency
end

#current_priceObject

Returns the value of attribute current_price.



6
7
8
# File 'lib/motion-paddle/paddle.rb', line 6

def current_price
  @current_price
end

#dev_nameObject

Returns the value of attribute dev_name.



6
7
8
# File 'lib/motion-paddle/paddle.rb', line 6

def dev_name
  @dev_name
end

#imageObject

Returns the value of attribute image.



6
7
8
# File 'lib/motion-paddle/paddle.rb', line 6

def image
  @image
end

#product_idObject

Returns the value of attribute product_id.



6
7
8
# File 'lib/motion-paddle/paddle.rb', line 6

def product_id
  @product_id
end

#product_imageObject

Returns the value of attribute product_image.



6
7
8
# File 'lib/motion-paddle/paddle.rb', line 6

def product_image
  @product_image
end

#product_nameObject

Returns the value of attribute product_name.



6
7
8
# File 'lib/motion-paddle/paddle.rb', line 6

def product_name
  @product_name
end

#time_trialObject

Returns the value of attribute time_trial.



6
7
8
# File 'lib/motion-paddle/paddle.rb', line 6

def time_trial
  @time_trial
end

#trial_durationObject

Returns the value of attribute trial_duration.



6
7
8
# File 'lib/motion-paddle/paddle.rb', line 6

def trial_duration
  @trial_duration
end

#trial_textObject

Returns the value of attribute trial_text.



6
7
8
# File 'lib/motion-paddle/paddle.rb', line 6

def trial_text
  @trial_text
end

#vendor_idObject

Returns the value of attribute vendor_id.



6
7
8
# File 'lib/motion-paddle/paddle.rb', line 6

def vendor_id
  @vendor_id
end

Instance Method Details

#inspectObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/motion-paddle/paddle.rb', line 18

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
  }.inspect
end

#set(var, val) ⇒ Object



12
13
14
15
16
# File 'lib/motion-paddle/paddle.rb', line 12

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