Module: Gamefic::Sdk::Platform

Defined in:
lib/gamefic-sdk/platform.rb

Defined Under Namespace

Classes: Base, Gfic, Sinatra, Web

Class Method Summary collapse

Class Method Details

.load(config, name) ⇒ Object

def self.load directory, platform

config_file = File.join(directory, 'config.yaml')

end

Raises:

  • (ArgumentError)


13
14
15
16
17
18
19
# File 'lib/gamefic-sdk/platform.rb', line 13

def self.load config, name
  target = config.targets[name]
  raise ArgumentError.new("Config does not have a target '#{name}'") if target.nil?
  cls = Gamefic::Sdk::Platform.const_get(target['platform'])
  raise ArgumentError.new("Platform '#{target['platform']}' not found") if target.nil?
  cls.new(config: config, target: target.merge('name' => name))
end