Module: Ramekin::SPCPlayer

Defined in:
lib/ramekin/spc_player.rb

Defined Under Namespace

Classes: CustomSPCPlayer, NormalSPCPlayer, SPCPlayer, WindowsSPCPlayer

Class Method Summary collapse

Class Method Details

.instance(*a) ⇒ Object



17
18
19
# File 'lib/ramekin/spc_player.rb', line 17

def self.instance(*a)
  @instance ||= make_instance
end

.make_instanceObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/ramekin/spc_player.rb', line 3

def self.make_instance
  config = Ramekin.config.spc_player
  unless config == '__auto__'
    if config.start_with?('./') || config.start_with?('.\\')
      return CustomSPCPlayer.new(File.expand_path(config, HOME))
    else
      return CustomSPCPlayer.new(config)
    end
  end

  return WindowsSPCPlayer.new if Ramekin.config.windows?
  NormalSPCPlayer.new
end