Exception: MPlayer::Error::StartupError

Inherits:
MPlayerError
  • Object
show all
Defined in:
lib/easy_mplayer/errors.rb

Direct Known Subclasses

NoPlayerFound, NoTargetPath

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ StartupError

Returns a new instance of StartupError.



15
16
17
18
# File 'lib/easy_mplayer/errors.rb', line 15

def initialize(path)
  @path = path
  super(to_s)
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



8
9
10
# File 'lib/easy_mplayer/errors.rb', line 8

def path
  @path
end

Instance Method Details

#to_sObject



10
11
12
13
# File 'lib/easy_mplayer/errors.rb', line 10

def to_s
  str = "Missing startup requirement!\n"
  str += "File \"#{path}\" does not exist!\n" unless File.exists?(path)
end