Class: Pixel
- Inherits:
-
Object
- Object
- Pixel
- Defined in:
- lib/console_splash/pixel.rb
Instance Attribute Summary collapse
-
#bcolor ⇒ Object
Returns the value of attribute bcolor.
-
#char ⇒ Object
Returns the value of attribute char.
-
#fcolor ⇒ Object
Returns the value of attribute fcolor.
Instance Method Summary collapse
-
#initialize(char = ' ', fcolor = :white, bcolor = nil) ⇒ Pixel
constructor
A new instance of Pixel.
- #print_pixel ⇒ Object
Constructor Details
#initialize(char = ' ', fcolor = :white, bcolor = nil) ⇒ Pixel
Returns a new instance of Pixel.
10 11 12 13 14 |
# File 'lib/console_splash/pixel.rb', line 10 def initialize( char=' ', fcolor=:white, bcolor=nil ) @char = char @fcolor = fcolor @bcolor = bcolor end |
Instance Attribute Details
#bcolor ⇒ Object
Returns the value of attribute bcolor.
8 9 10 |
# File 'lib/console_splash/pixel.rb', line 8 def bcolor @bcolor end |
#char ⇒ Object
Returns the value of attribute char.
8 9 10 |
# File 'lib/console_splash/pixel.rb', line 8 def char @char end |
#fcolor ⇒ Object
Returns the value of attribute fcolor.
8 9 10 |
# File 'lib/console_splash/pixel.rb', line 8 def fcolor @fcolor end |
Instance Method Details
#print_pixel ⇒ Object
16 17 18 |
# File 'lib/console_splash/pixel.rb', line 16 def print_pixel print char.colorize( :color => fcolor, :background => bcolor ) end |