Class: FabricConfig

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ FabricConfig

Returns a new instance of FabricConfig.



56
57
58
59
60
# File 'lib/motion-fabric.rb', line 56

def initialize(config)
  @config = config
  config.info_plist['Fabric'] ||= {}
  config.info_plist['Fabric']['Kits'] ||= []
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



49
50
51
# File 'lib/motion-fabric.rb', line 49

def api_key
  @api_key
end

#beta_blockObject

Returns the value of attribute beta_block.



49
50
51
# File 'lib/motion-fabric.rb', line 49

def beta_block
  @beta_block
end

#build_secretObject

Returns the value of attribute build_secret.



49
50
51
# File 'lib/motion-fabric.rb', line 49

def build_secret
  @build_secret
end

#kitsObject

Returns the value of attribute kits.



49
50
51
# File 'lib/motion-fabric.rb', line 49

def kits
  @kits
end

Instance Method Details

#beta(&block) ⇒ Object



68
69
70
# File 'lib/motion-fabric.rb', line 68

def beta(&block)
  @beta_block = block if block
end

#kit(name, &block) ⇒ Object



62
63
64
65
66
# File 'lib/motion-fabric.rb', line 62

def kit(name, &block)
  kit_config = FabricKitConfig.new(name)
  block.call(kit_config.info) if block
  @config.info_plist['Fabric']['Kits'] << kit_config.to_hash
end