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

#black ⇒ Object



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

#blue ⇒ Object



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

def blue
  self
end

#bright ⇒ Object 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_out ⇒ Object Also known as: strike



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

def cross_out
  self
end

#cyan ⇒ Object



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

def cyan
  self
end

#faint ⇒ Object Also known as: dark



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

def faint
  self
end

#green ⇒ Object



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

def green
  self
end

#hide ⇒ Object



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

def hide
  self
end

#inverse ⇒ Object



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

def inverse
  self
end

#italic ⇒ Object



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

def italic
  self
end

#magenta ⇒ Object



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

def magenta
  self
end

#red ⇒ Object



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

def red
  self
end

#reset ⇒ Object



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

#underline ⇒ Object



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

def underline
  self
end

#white ⇒ Object



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

def white
  self
end

#yellow ⇒ Object



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

def yellow
  self
end