Class: EvernoteLinkExtractor::Helper

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

Overview

some helper methods

Class Method Summary collapse

Class Method Details

.closeObject

close the program



13
14
15
16
# File 'lib/evernote_link_extractor/helper.rb', line 13

def close
  message("\nClosing. Have a nice day!\n")
  exit(0)
end

.exit?Boolean

exit the whole program?

Returns:

  • (Boolean)


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 message(m)
  print pastel.green(m)
end

.pastelObject



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