Class: Pry::Larry::LarryCommand

Inherits:
ClassCommand
  • Object
show all
Defined in:
lib/pry-larry.rb

Constant Summary collapse

TENSE_MAPPING =
{
  'start'  => 'started',
  'wakeup' => 'woken up',
  'chill'  => 'chilled',
  'stop' => 'stopped'
}
START_COMMANDS =
["start", "wakeup"]

Instance Method Summary collapse

Instance Method Details

#process(input) ⇒ Object



61
62
63
64
65
66
67
68
69
# File 'lib/pry-larry.rb', line 61

def process(input)
  if START_COMMANDS.include?(input)
    Pry::Larry.start(_pry_)
    _pry_.pager.page("Alright, I have #{TENSE_MAPPING[input]}.")
  else
    Pry::Larry.stop(_pry_)
    _pry_.pager.page("Alright, I have #{TENSE_MAPPING[input]}.")
  end
end