Class: Phonemico::Runner

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

Instance Method Summary collapse

Constructor Details

#initialize(features, console = HighLine.new) ⇒ Runner

Returns a new instance of Runner.



75
76
77
78
# File 'lib/phonemico.rb', line 75

def initialize(features, console = HighLine.new)
  @features = features
  @highline = console
end

Instance Method Details

#runObject



80
81
82
83
84
85
86
87
# File 'lib/phonemico.rb', line 80

def run
  @highline.choose do |menu|
    menu.choice('List all features for a given sound')              {find_features}
    menu.choice('List all sounds that share a given feature value') {find_phonemes}
    menu.choice('List all shared features for two or more sounds')  {find_common_features}
    menu.prompt = 'What would you like to do?'
  end
end