Class: RubyText::Effects
- Inherits:
-
Object
- Object
- RubyText::Effects
- Defined in:
- lib/effects.rb
Overview
dumb name?
Constant Summary collapse
- Modes =
{bold: X::A_BOLD, normal: X:: A_NORMAL, reverse: X:: A_REVERSE, under: X:: A_UNDERLINE}
- Others =
show/hide cursor; more later??
%[:show, :hide]
Instance Attribute Summary collapse
-
#fg ⇒ Object
readonly
Returns the value of attribute fg.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(win, *args) ⇒ Effects
constructor
A new instance of Effects.
Constructor Details
#initialize(win, *args) ⇒ Effects
Returns a new instance of Effects.
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/effects.rb', line 11 def initialize(win, *args) bits = 0 args.each do |arg| if Modes.keys.include?(arg) val = Modes[arg] bits ||= val elsif ::Colors.include?(arg) @fg = arg # symbol end end @value = bits X.attrset(bits) end |
Instance Attribute Details
#fg ⇒ Object (readonly)
Returns the value of attribute fg.
9 10 11 |
# File 'lib/effects.rb', line 9 def fg @fg end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
9 10 11 |
# File 'lib/effects.rb', line 9 def value @value end |