Class: Peanut::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/peanut/command.rb

Class Method Summary collapse

Class Method Details

.run(*args) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/peanut/command.rb', line 5

def run(*args)
  key = args.shift
  value = args.join(' ') unless args.length == 0
  
  return help unless key
  return send key, value if is_arged_keyword?(key)
  return send key if is_keyword?(key)
  return save! key, value if key && value
  return get key
end