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



75
76
77
78
79
80
81
# File 'lib/rainbow/null_presenter.rb', line 75

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



7
8
9
# File 'lib/rainbow/null_presenter.rb', line 7

def background(*_values)
  self
end

#blackObject



43
44
45
# File 'lib/rainbow/null_presenter.rb', line 43

def black
  self
end


31
32
33
# File 'lib/rainbow/null_presenter.rb', line 31

def blink
  self
end

#blueObject



59
60
61
# File 'lib/rainbow/null_presenter.rb', line 59

def blue
  self
end

#brightObject Also known as: bold



15
16
17
# File 'lib/rainbow/null_presenter.rb', line 15

def bright
  self
end

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



3
4
5
# File 'lib/rainbow/null_presenter.rb', line 3

def color(*_values)
  self
end

#cyanObject



67
68
69
# File 'lib/rainbow/null_presenter.rb', line 67

def cyan
  self
end

#faintObject Also known as: dark



19
20
21
# File 'lib/rainbow/null_presenter.rb', line 19

def faint
  self
end

#greenObject



51
52
53
# File 'lib/rainbow/null_presenter.rb', line 51

def green
  self
end

#hideObject



39
40
41
# File 'lib/rainbow/null_presenter.rb', line 39

def hide
  self
end

#inverseObject



35
36
37
# File 'lib/rainbow/null_presenter.rb', line 35

def inverse
  self
end

#italicObject



23
24
25
# File 'lib/rainbow/null_presenter.rb', line 23

def italic
  self
end

#magentaObject



63
64
65
# File 'lib/rainbow/null_presenter.rb', line 63

def magenta
  self
end

#redObject



47
48
49
# File 'lib/rainbow/null_presenter.rb', line 47

def red
  self
end

#resetObject



11
12
13
# File 'lib/rainbow/null_presenter.rb', line 11

def reset
  self
end

#respond_to_missing?(method_name, *args) ⇒ Boolean

Returns:

  • (Boolean)


83
84
85
# File 'lib/rainbow/null_presenter.rb', line 83

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

#underlineObject



27
28
29
# File 'lib/rainbow/null_presenter.rb', line 27

def underline
  self
end

#whiteObject



71
72
73
# File 'lib/rainbow/null_presenter.rb', line 71

def white
  self
end

#yellowObject



55
56
57
# File 'lib/rainbow/null_presenter.rb', line 55

def yellow
  self
end