Class: Tco::Style
- Inherits:
-
Object
- Object
- Tco::Style
- Defined in:
- lib/tco/style.rb
Instance Attribute Summary collapse
-
#bg ⇒ Object
Returns the value of attribute bg.
-
#bright ⇒ Object
Returns the value of attribute bright.
-
#fg ⇒ Object
Returns the value of attribute fg.
-
#underline ⇒ Object
Returns the value of attribute underline.
Instance Method Summary collapse
- #==(o) ⇒ Object
-
#initialize(fg = nil, bg = nil, bright = false, underline = false) ⇒ Style
constructor
A new instance of Style.
- #to_a ⇒ Object
- #to_ary ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(fg = nil, bg = nil, bright = false, underline = false) ⇒ Style
Returns a new instance of Style.
28 29 30 31 32 33 |
# File 'lib/tco/style.rb', line 28 def initialize(fg=nil, bg=nil, bright=false, underline=false) @fg = fg @bg = bg @bright = bright @underline = underline end |
Instance Attribute Details
#bg ⇒ Object
Returns the value of attribute bg.
26 27 28 |
# File 'lib/tco/style.rb', line 26 def bg @bg end |
#bright ⇒ Object
Returns the value of attribute bright.
26 27 28 |
# File 'lib/tco/style.rb', line 26 def bright @bright end |
#fg ⇒ Object
Returns the value of attribute fg.
26 27 28 |
# File 'lib/tco/style.rb', line 26 def fg @fg end |
#underline ⇒ Object
Returns the value of attribute underline.
26 27 28 |
# File 'lib/tco/style.rb', line 26 def underline @underline end |
Instance Method Details
#==(o) ⇒ Object
47 48 49 |
# File 'lib/tco/style.rb', line 47 def ==(o) @fg == o.fg && @bg == o.bg && @bright == o.bright && @underline == o.underline end |
#to_a ⇒ Object
35 36 37 |
# File 'lib/tco/style.rb', line 35 def to_a [@fg, @bg, @bright, @underline] end |
#to_ary ⇒ Object
43 44 45 |
# File 'lib/tco/style.rb', line 43 def to_ary to_a end |
#to_h ⇒ Object
39 40 41 |
# File 'lib/tco/style.rb', line 39 def to_h {:fg => @fg, :bg => @bg, :bright => @bright, :underline => @underline} end |