Class: TextStyle
Instance Attribute Summary collapse
-
#bold ⇒ Object
Returns the value of attribute bold.
-
#code ⇒ Object
Returns the value of attribute code.
-
#italic ⇒ Object
Returns the value of attribute italic.
Attributes inherited from Style
Instance Method Summary collapse
Methods inherited from Style
#base_style, #child_of?, #initialize
Constructor Details
This class inherits a constructor from Style
Instance Attribute Details
#bold ⇒ Object
Returns the value of attribute bold.
24 25 26 |
# File 'lib/yesroff/text.rb', line 24 def bold @bold end |
#code ⇒ Object
Returns the value of attribute code.
24 25 26 |
# File 'lib/yesroff/text.rb', line 24 def code @code end |
#italic ⇒ Object
Returns the value of attribute italic.
24 25 26 |
# File 'lib/yesroff/text.rb', line 24 def italic @italic end |
Instance Method Details
#render(w) ⇒ Object
34 35 36 37 38 |
# File 'lib/yesroff/text.rb', line 34 def render(w) w.toggle_bold if @bold w.toggle_code if @code w.toggle_italic if @italic end |
#to_s ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/yesroff/text.rb', line 26 def to_s result = "[Style: #{name}" result += 'B' if @bold result += 'I' if @italic result += 'C' if @code result += ']' end |