Class: Dogsay::TextBox

Inherits:
Object
  • Object
show all
Includes:
AsciiArt
Defined in:
lib/dogsay/text_box.rb

Instance Attribute Summary collapse

Attributes included from AsciiArt

#ascii

Instance Method Summary collapse

Methods included from AsciiArt

#add_art

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

#justifyObject (readonly)

Returns the value of attribute justify.



3
4
5
# File 'lib/dogsay/text_box.rb', line 3

def justify
  @justify
end

#rawObject (readonly)

Returns the value of attribute raw.



3
4
5
# File 'lib/dogsay/text_box.rb', line 3

def raw
  @raw
end

#separatorObject (readonly)

Returns the value of attribute separator.



3
4
5
# File 'lib/dogsay/text_box.rb', line 3

def separator
  @separator
end

#text_widthObject (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