lib/anyplayer/command_line.rb
# Call the method on the player
# Tries the boolean method as well
Call the method on the player
Tries the boolean method as well
Call the method on the player Tries the boolean method as well
def call(player, command)
    [command, "#{command}?"].each do |method|
      method = method.to_sym
      return player.send(method) if player.respond_to?(method)
    end
    :undefined_command
  end
def call ( player , command ) [ command , "#{command}?" ] . each do | method | method = method . to_sym return player . send ( method ) if player . respond_to? ( method ) end :undefined_command end
Call the method on the player
Tries the boolean method as well
Call the method on the player Tries the boolean method as well
player
<not_specific>
command
<not_specific>