Sha256: 40cea4829c91ef671bcbadd452c68030c428310d4a78a91db1f7f08f186b3da8

Contents?: true

Size: 762 Bytes

Versions: 1

Compression:

Stored size: 762 Bytes

Contents

module Gamefic::Sdk

  module Platform
    autoload :Base, 'gamefic-sdk/platform/base'
    autoload :Gfic, 'gamefic-sdk/platform/gfic'
    autoload :Web, 'gamefic-sdk/platform/web'
    autoload :Sinatra, 'gamefic-sdk/platform/sinatra'

    #def self.load directory, platform
    #  config_file = File.join(directory, 'config.yaml')
    #end

    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
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gamefic-sdk-1.7.0 lib/gamefic-sdk/platform.rb