Class: Eskimo::ASCII::Style
- Defined in:
- gems/eskimo-ascii/lib/eskimo/ascii/components/style.rb
Overview
Style text with colors and custom formatting.
See Pastel’s documentation for the accepted styles.
Instance Attribute Summary collapse
-
#pastel ⇒ Object
readonly
Returns the value of attribute pastel.
-
#style ⇒ Object
readonly
Returns the value of attribute style.
Instance Method Summary collapse
-
#initialize(*style, &children) ⇒ Style
constructor
A new instance of Style.
- #render ⇒ Object
Constructor Details
#initialize(*style, &children) ⇒ Style
Returns a new instance of Style
12 13 14 15 16 17 |
# File 'gems/eskimo-ascii/lib/eskimo/ascii/components/style.rb', line 12 def initialize(*style, &children) @style = style.flatten @pastel = Pastel.new super end |
Instance Attribute Details
#pastel ⇒ Object (readonly)
Returns the value of attribute pastel
10 11 12 |
# File 'gems/eskimo-ascii/lib/eskimo/ascii/components/style.rb', line 10 def pastel @pastel end |
#style ⇒ Object (readonly)
Returns the value of attribute style
10 11 12 |
# File 'gems/eskimo-ascii/lib/eskimo/ascii/components/style.rb', line 10 def style @style end |
Instance Method Details
#render ⇒ Object
19 20 21 |
# File 'gems/eskimo-ascii/lib/eskimo/ascii/components/style.rb', line 19 def render(**) pastel.decorate(super, *style) end |