class Degica::Action

{Actionable} objects return actions. These actions can be invoked in the game REPL and delegate function calls to a +@target+ ruby object method.

Attributes

name[R]
target[R]

Public Class Methods

new(name_, target_) click to toggle source
# File lib/degica/action.rb, line 8
def initialize(name_, target_)
  @name = name_
  @target = target_
end

Public Instance Methods

do(*args) click to toggle source
# File lib/degica/action.rb, line 13
def do(*args)
  if @target.respond_to?(name)
    @target.send(name, *args)
  else
    @target
  end
end
inspect() click to toggle source
# File lib/degica/action.rb, line 21
def inspect
  "#{@name}"
end