Class: FoggyBottom::Console

Inherits:
Object
  • Object
show all
Defined in:
lib/foggy_bottom/console.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api) ⇒ Console

Returns a new instance of Console.



6
7
8
# File 'lib/foggy_bottom/console.rb', line 6

def initialize(api)
  @api = api
end

Instance Attribute Details

#apiObject

Returns the value of attribute api.



5
6
7
# File 'lib/foggy_bottom/console.rb', line 5

def api
  @api
end

Instance Method Details

#runObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/foggy_bottom/console.rb', line 10

def run
  while( cmd = show_menu ) do
    case cmd
    when :search
      search(get("Terms"))
    when :resolve
      resolve(get("Case ID"))
    when :status_list
      puts FoggyBottom::Status.all(api).inspect
    when :quit
      exit 0
    else
      puts " Unknown choice"
    end
  end
end