class FourTwoSeven::Command
Constants
- DURATION
- KEYS
- PROMPT
- SEPARATOR
Attributes
prev_command[RW]
Public Class Methods
new(prev_command = nil)
click to toggle source
# File lib/427/command.rb, line 19 def initialize(prev_command = nil) @prev_command = prev_command end
Public Instance Methods
duration()
click to toggle source
# File lib/427/command.rb, line 31 def duration 0 #@duration ||= rand(DURATION) end
key()
click to toggle source
# File lib/427/command.rb, line 23 def key @key ||= if prev_command KEYS - [prev_command.key] else KEYS end.sample end
prompt()
click to toggle source
# File lib/427/command.rb, line 36 def prompt PROMPT % [key, duration] end