Class: ScrollySign::TextBuilder
- Inherits:
-
Object
- Object
- ScrollySign::TextBuilder
- Defined in:
- lib/scrollysign.rb
Instance Method Summary collapse
- #control(*controls) ⇒ Object
-
#initialize ⇒ TextBuilder
constructor
A new instance of TextBuilder.
- #text(text) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ TextBuilder
Returns a new instance of TextBuilder.
7 8 9 |
# File 'lib/scrollysign.rb', line 7 def initialize @text = "" end |
Instance Method Details
#control(*controls) ⇒ Object
15 16 17 18 19 |
# File 'lib/scrollysign.rb', line 15 def control(*controls) controls.each do |control| @text << ScrollySign::CONTROLS.fetch(control) end end |
#text(text) ⇒ Object
11 12 13 |
# File 'lib/scrollysign.rb', line 11 def text(text) @text << text.to_s end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/scrollysign.rb', line 21 def to_s @text end |