Module: CapeCod
- Defined in:
- lib/cape-cod.rb,
lib/cape-cod/color.rb,
lib/cape-cod/version.rb
Defined Under Namespace
Classes: Color
Constant Summary collapse
- EFFECTS =
{ reset: 0, bold: 1, dark: 2, italic: 3, underline: 4, blink: 5, rapid_blink: 6, negative: 7, concealed: 8, strikethrough: 9 }.freeze
- VERSION =
'0.1.3'
Class Attribute Summary collapse
-
.enabled ⇒ Object
(also: enabled?)
Returns the value of attribute enabled.
Class Method Summary collapse
-
.background(*color, target) ⇒ Object
(also: bg)
:nodoc:.
-
.effect(effect, target) ⇒ Object
(also: fx)
:nodoc:.
-
.foreground(*color, target) ⇒ Object
(also: fg)
:nodoc:.
Instance Method Summary collapse
-
#background(*color) ⇒ Object
:nodoc:.
-
#bg ⇒ Object
:nodoc:.
-
#effect(effect) ⇒ Object
:nodoc:.
-
#fg ⇒ Object
:nodoc:.
-
#foreground(*color) ⇒ Object
:nodoc:.
-
#fx ⇒ Object
:nodoc:.
Class Attribute Details
.enabled ⇒ Object Also known as: enabled?
Returns the value of attribute enabled.
95 96 97 |
# File 'lib/cape-cod.rb', line 95 def enabled @enabled end |
Class Method Details
.background(*color, target) ⇒ Object Also known as: bg
:nodoc:
102 103 104 |
# File 'lib/cape-cod.rb', line 102 def background(*color, target) # :nodoc: apply_escape_sequence(color_code_for(*color, :background), target) end |
.effect(effect, target) ⇒ Object Also known as: fx
:nodoc:
106 107 108 |
# File 'lib/cape-cod.rb', line 106 def effect(effect, target) # :nodoc: apply_escape_sequence(effect_code_for(effect), target) end |
.foreground(*color, target) ⇒ Object Also known as: fg
:nodoc:
98 99 100 |
# File 'lib/cape-cod.rb', line 98 def foreground(*color, target) # :nodoc: apply_escape_sequence(color_code_for(*color, :foreground), target) end |
Instance Method Details
#background(*color) ⇒ Object
:nodoc:
81 82 83 |
# File 'lib/cape-cod.rb', line 81 def background(*color) # :nodoc: CapeCod.background(*color, self) end |
#bg ⇒ Object
:nodoc:
90 91 92 |
# File 'lib/cape-cod.rb', line 90 def background(*color) # :nodoc: CapeCod.background(*color, self) end |
#effect(effect) ⇒ Object
:nodoc:
85 86 87 |
# File 'lib/cape-cod.rb', line 85 def effect(effect) # :nodoc: CapeCod.effect(effect, self) end |
#fg ⇒ Object
:nodoc:
89 90 91 |
# File 'lib/cape-cod.rb', line 89 def foreground(*color) # :nodoc: CapeCod.foreground(*color, self) end |
#foreground(*color) ⇒ Object
:nodoc:
77 78 79 |
# File 'lib/cape-cod.rb', line 77 def foreground(*color) # :nodoc: CapeCod.foreground(*color, self) end |