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
#start(w) ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/yesroff/text.rb', line 34 def start(w) if @bold w.start_bold elsif @italic w.start_italic elsif @code w.start_code end end |
#stop(w) ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'lib/yesroff/text.rb', line 44 def stop(w) if @bold w.end_bold elsif @italic w.end_italic elsif @code w.end_code end 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 |