Class: Brewby::CLI::Application

Inherits:
Application
  • Object
show all
Defined in:
lib/brewby/cli/application.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Application

Returns a new instance of Application.



9
10
11
12
# File 'lib/brewby/cli/application.rb', line 9

def initialize options = {}
  super  
  configure_view
end

Instance Attribute Details

#readyObject

Returns the value of attribute ready.



7
8
9
# File 'lib/brewby/cli/application.rb', line 7

def ready
  @ready
end

#viewObject (readonly)

Returns the value of attribute view.



8
9
10
# File 'lib/brewby/cli/application.rb', line 8

def view
  @view
end

Instance Method Details

#configure_viewObject



14
15
16
# File 'lib/brewby/cli/application.rb', line 14

def configure_view
  @view = Brewby::CLI::Views::Application.new self
end

#startObject



18
19
20
21
22
# File 'lib/brewby/cli/application.rb', line 18

def start
  super
ensure
  view.clear if view
end

#start_step(step) ⇒ Object



24
25
26
27
# File 'lib/brewby/cli/application.rb', line 24

def start_step step
  super 
  view.load_step_view step
end

#tickObject



29
30
31
32
33
# File 'lib/brewby/cli/application.rb', line 29

def tick
  super
  view.render
  view.handle_input
end