Class: Evertils::Controller::Get
- Defined in:
- lib/evertils/controllers/get.rb
Constant Summary
Constants inherited from Base
Base::OK, Base::QUIT, Base::QUIT_SOFT
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#notebook ⇒ Object
Get data about a notebook, prints titles of each child note.
-
#title ⇒ Object
Returns the value of attribute title.
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#can_exec?, #exec, #initialize, #post_exec, #sample
Constructor Details
This class inherits a constructor from Evertils::Controller::Base
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
4 5 6 |
# File 'lib/evertils/controllers/get.rb', line 4 def file @file end |
#notebook ⇒ Object
Get data about a notebook, prints titles of each child note
28 29 30 |
# File 'lib/evertils/controllers/get.rb', line 28 def notebook @notebook end |
#title ⇒ Object
Returns the value of attribute title.
4 5 6 |
# File 'lib/evertils/controllers/get.rb', line 4 def title @title end |
Instance Method Details
#info ⇒ Object
48 49 50 51 52 |
# File 'lib/evertils/controllers/get.rb', line 48 def info @config..each_pair do |key, value| Notify.spit("#{key}: #{value}") end end |
#pre_exec ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/evertils/controllers/get.rb', line 6 def pre_exec # command flag parser OptionParser.new do |opt| opt. = "evertils new note [...-flags]" opt.on("-t", "--title=TITLE", "Set a custom title") do |title| @title = title end opt.on("-f", "--file=PATH", "Attach a file to your custom note") do |file| @file = file end opt.on("-n", "--notebook=PBOOK", "Attach a file to your custom note") do |notebook| @notebook = notebook end end.parse! super end |