Class: Dogsay::TextBox
- Inherits:
-
Object
- Object
- Dogsay::TextBox
- Includes:
- AsciiArt
- Defined in:
- lib/dogsay/text_box.rb
Instance Attribute Summary collapse
-
#justify ⇒ Object
readonly
Returns the value of attribute justify.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#separator ⇒ Object
readonly
Returns the value of attribute separator.
-
#text_width ⇒ Object
readonly
Returns the value of attribute text_width.
Attributes included from AsciiArt
Instance Method Summary collapse
-
#initialize(text, opts = {}) ⇒ TextBox
constructor
A new instance of TextBox.
Methods included from AsciiArt
Constructor Details
#initialize(text, opts = {}) ⇒ TextBox
Returns a new instance of TextBox.
4 5 6 7 8 9 10 11 |
# File 'lib/dogsay/text_box.rb', line 4 def initialize(text, opts={}) config = defaults.merge(opts) @text_width = config[:text_width] @separator = config[:strip] ? ' ' : / / @justify = config[:justify] @raw = raw_from(text) @ascii = ascii_from(text) end |
Instance Attribute Details
#justify ⇒ Object (readonly)
Returns the value of attribute justify.
3 4 5 |
# File 'lib/dogsay/text_box.rb', line 3 def justify @justify end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
3 4 5 |
# File 'lib/dogsay/text_box.rb', line 3 def raw @raw end |
#separator ⇒ Object (readonly)
Returns the value of attribute separator.
3 4 5 |
# File 'lib/dogsay/text_box.rb', line 3 def separator @separator end |
#text_width ⇒ Object (readonly)
Returns the value of attribute text_width.
3 4 5 |
# File 'lib/dogsay/text_box.rb', line 3 def text_width @text_width end |