Class: Shoes::Text

Inherits:
Object show all
Defined in:
lib/shoes/text.rb

Direct Known Subclasses

Link

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(m, str, color = nil) ⇒ Text

Returns a new instance of Text.



26
27
28
29
# File 'lib/shoes/text.rb', line 26

def initialize m, str, color=nil
  @style, @str, @color = m, str, color
  @to_s = str.map(&:to_s).join
end

Instance Attribute Details

#colorObject (readonly)

Returns the value of attribute color.



30
31
32
# File 'lib/shoes/text.rb', line 30

def color
  @color
end

#strObject (readonly)

Returns the value of attribute str.



30
31
32
# File 'lib/shoes/text.rb', line 30

def str
  @str
end

#styleObject (readonly)

Returns the value of attribute style.



30
31
32
# File 'lib/shoes/text.rb', line 30

def style
  @style
end

#to_sObject (readonly)

Returns the value of attribute to_s.



30
31
32
# File 'lib/shoes/text.rb', line 30

def to_s
  @to_s
end