Class: Changi::Reader::CategoryReader
- Inherits:
-
StringReader
- Object
- StringReader
- Changi::Reader::CategoryReader
- Defined in:
- lib/changi/reader/category_reader.rb
Instance Method Summary collapse
Instance Method Details
#read(attribute, owner) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/changi/reader/category_reader.rb', line 4 def read attribute, owner raise 'CategoryReader can only be used for Entry attributes.' unless owner.is_a? Entry cli.say "#{attribute[:name].capitalize}:\n" cli.choose do || .choices(*categories(owner.entry_set)) .choice 'Other (create new)' do cli.ask "Please insert #{attribute[:name]}:" end .choice('Abort') { exit } end end |