Class: Rainbow::NullPresenter

Inherits:
String
  • Object
show all
Defined in:
lib/rainbow/null_presenter.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args) ⇒ Object



81
82
83
84
85
86
87
# File 'lib/rainbow/null_presenter.rb', line 81

def method_missing(method_name, *args)
  if Color::X11Named.color_names.include?(method_name) && args.empty?
    self
  else
    super
  end
end

Instance Method Details

#background(*_values) ⇒ Object Also known as: bg



9
10
11
# File 'lib/rainbow/null_presenter.rb', line 9

def background(*_values)
  self
end

#blackObject



49
50
51
# File 'lib/rainbow/null_presenter.rb', line 49

def black
  self
end


33
34
35
# File 'lib/rainbow/null_presenter.rb', line 33

def blink
  self
end

#blueObject



65
66
67
# File 'lib/rainbow/null_presenter.rb', line 65

def blue
  self
end

#brightObject Also known as: bold



17
18
19
# File 'lib/rainbow/null_presenter.rb', line 17

def bright
  self
end

#color(*_values) ⇒ Object Also known as: foreground, fg



5
6
7
# File 'lib/rainbow/null_presenter.rb', line 5

def color(*_values)
  self
end

#cross_outObject Also known as: strike



45
46
47
# File 'lib/rainbow/null_presenter.rb', line 45

def cross_out
  self
end

#cyanObject



73
74
75
# File 'lib/rainbow/null_presenter.rb', line 73

def cyan
  self
end

#faintObject Also known as: dark



21
22
23
# File 'lib/rainbow/null_presenter.rb', line 21

def faint
  self
end

#greenObject



57
58
59
# File 'lib/rainbow/null_presenter.rb', line 57

def green
  self
end

#hideObject



41
42
43
# File 'lib/rainbow/null_presenter.rb', line 41

def hide
  self
end

#inverseObject



37
38
39
# File 'lib/rainbow/null_presenter.rb', line 37

def inverse
  self
end

#italicObject



25
26
27
# File 'lib/rainbow/null_presenter.rb', line 25

def italic
  self
end

#magentaObject



69
70
71
# File 'lib/rainbow/null_presenter.rb', line 69

def magenta
  self
end

#redObject



53
54
55
# File 'lib/rainbow/null_presenter.rb', line 53

def red
  self
end

#resetObject



13
14
15
# File 'lib/rainbow/null_presenter.rb', line 13

def reset
  self
end

#respond_to_missing?(method_name, *args) ⇒ Boolean

Returns:

  • (Boolean)


89
90
91
# File 'lib/rainbow/null_presenter.rb', line 89

def respond_to_missing?(method_name, *args)
  Color::X11Named.color_names.include?(method_name) && args.empty? || super
end

#underlineObject



29
30
31
# File 'lib/rainbow/null_presenter.rb', line 29

def underline
  self
end

#whiteObject



77
78
79
# File 'lib/rainbow/null_presenter.rb', line 77

def white
  self
end

#yellowObject



61
62
63
# File 'lib/rainbow/null_presenter.rb', line 61

def yellow
  self
end