Class: Checkout::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/checkout/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max) ⇒ Runner



7
8
9
10
# File 'lib/checkout/runner.rb', line 7

def initialize(max)
  get_max(max)
  run!
end

Instance Attribute Details

#branchObject

Returns the value of attribute branch.



5
6
7
# File 'lib/checkout/runner.rb', line 5

def branch
  @branch
end

#branch_choice_object=(value) ⇒ Object

Sets the attribute branch_choice_object



5
6
7
# File 'lib/checkout/runner.rb', line 5

def branch_choice_object=(value)
  @branch_choice_object = value
end

#branches=(value) ⇒ Object

Sets the attribute branches



5
6
7
# File 'lib/checkout/runner.rb', line 5

def branches=(value)
  @branches = value
end

#maxObject

Returns the value of attribute max.



5
6
7
# File 'lib/checkout/runner.rb', line 5

def max
  @max
end

#selectionObject

Returns the value of attribute selection.



5
6
7
# File 'lib/checkout/runner.rb', line 5

def selection
  @selection
end

Instance Method Details

#run!Object



12
13
14
15
16
# File 'lib/checkout/runner.rb', line 12

def run!
  ask_for_selection
  map_selection_to_branch
  checkout
end