Exception: MPlayer::Error::BadCall

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

Overview

an error in sending a command to mplayer over its slave-mode API

Direct Known Subclasses

BadCallArgs, BadCallName

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, called_args) ⇒ BadCall

Returns a new instance of BadCall.



73
74
75
76
77
# File 'lib/easy_mplayer/errors.rb', line 73

def initialize(command, called_args)
  @cmd  = command
  @args = called_args
  super(to_s)
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



60
61
62
# File 'lib/easy_mplayer/errors.rb', line 60

def args
  @args
end

#cmdObject (readonly)

Returns the value of attribute cmd.



60
61
62
# File 'lib/easy_mplayer/errors.rb', line 60

def cmd
  @cmd
end

Instance Method Details

#called_asObject

a type-prototype of how we attempted the mplayer API call



63
64
65
66
67
# File 'lib/easy_mplayer/errors.rb', line 63

def called_as
  "#{cmd}(" + args.map do |x|
    x.class
  end.join(", ") + ")"
end

#to_sObject



69
70
71
# File 'lib/easy_mplayer/errors.rb', line 69

def to_s
  "\nBad MPlayer call: #{called_as}"
end