module Degica::Actionable
Allows objects to be actionable in the game REPL. Actionable
objects can be focused, described, and can expose actions in the REPL.
Public Instance Methods
actions()
click to toggle source
@returns [Array<Degica::Action>] a list of actions.
# File lib/degica/actionable.rb, line 15 def actions [] end
describe()
click to toggle source
@returns [String] string describing the object.
# File lib/degica/actionable.rb, line 20 def describe nil end
do(name, *args)
click to toggle source
# File lib/degica/actionable.rb, line 24 def do(name, *args) actions.find { |action| action.name == name }.do(*args) end
prompt()
click to toggle source
Customized REPL prompt for action. For example, if the prompt method returned “book”
book> ...
# File lib/degica/actionable.rb, line 10 def prompt nil end