Class: Wpcap::Utility

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

Class Method Summary collapse

Class Method Details

.blue(text) ⇒ Object



21
# File 'lib/wpcap/utility.rb', line 21

def self.blue(text); self.colorize(text, 34); end

.colorize(text, color_code) ⇒ Object



15
16
17
# File 'lib/wpcap/utility.rb', line 15

def self.colorize(text, color_code)
  "\033[1m\e[#{color_code}m#{text}\e[0m\033[22m"
end

.error(text) ⇒ Object



3
4
5
# File 'lib/wpcap/utility.rb', line 3

def self.error(text)
  puts red("****#{text}****")
end

.green(text) ⇒ Object



20
# File 'lib/wpcap/utility.rb', line 20

def self.green(text); self.colorize(text, 32); end

.question(text) ⇒ Object



7
8
9
# File 'lib/wpcap/utility.rb', line 7

def self.question(text)
  puts blue("****#{text}****")
end

.red(text) ⇒ Object



19
# File 'lib/wpcap/utility.rb', line 19

def self.red(text); self.colorize(text, 31); end

.success(text) ⇒ Object



11
12
13
# File 'lib/wpcap/utility.rb', line 11

def self.success(text)
  puts green("****#{text}****")
end