Class: EvernoteLinkExtractor::Helper
- Inherits:
-
Object
- Object
- EvernoteLinkExtractor::Helper
- Defined in:
- lib/evernote_link_extractor/helper.rb
Overview
some helper methods
Class Method Summary collapse
-
.close ⇒ Object
close the program.
-
.exit? ⇒ Boolean
exit the whole program?.
- .headline(h) ⇒ Object
- .message(m) ⇒ Object
- .pastel ⇒ Object
- .question(q) ⇒ Object
- .warning(w) ⇒ Object
Class Method Details
.close ⇒ Object
close the program
13 14 15 16 |
# File 'lib/evernote_link_extractor/helper.rb', line 13 def close ("\nClosing. Have a nice day!\n") exit(0) end |
.exit? ⇒ Boolean
exit the whole program?
7 8 9 10 |
# File 'lib/evernote_link_extractor/helper.rb', line 7 def exit? print question('Exit? (yes|no): ') close if gets.chomp == 'yes' end |
.headline(h) ⇒ Object
30 31 32 |
# File 'lib/evernote_link_extractor/helper.rb', line 30 def headline(h) print pastel.white.on_cyan.bold(h) end |
.message(m) ⇒ Object
26 27 28 |
# File 'lib/evernote_link_extractor/helper.rb', line 26 def (m) print pastel.green(m) end |
.pastel ⇒ Object
34 35 36 |
# File 'lib/evernote_link_extractor/helper.rb', line 34 def pastel Pastel.new end |
.question(q) ⇒ Object
18 19 20 |
# File 'lib/evernote_link_extractor/helper.rb', line 18 def question(q) print pastel.yellow.bold(q) end |
.warning(w) ⇒ Object
22 23 24 |
# File 'lib/evernote_link_extractor/helper.rb', line 22 def warning(w) question(w) end |