Class: Vedeu::Clear Private
- Inherits:
-
Object
- Object
- Vedeu::Clear
- Defined in:
- lib/vedeu/output/clear.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Clears all the character data for the area defined by an interface. This class is called every time an interface is rendered to prepare the area for new data.
Instance Attribute Summary collapse
- #interface ⇒ Object readonly private private
Class Method Summary collapse
-
.call(interface) ⇒ String
private
Blanks the area defined by the interface.
Instance Method Summary collapse
-
#clear ⇒ String
private
For each visible line of the interface, set the foreground and background colours to those specified when the interface was defined, then starting write space characters over the area which the interface occupies.
- #colours ⇒ String private private
-
#initialize(interface) ⇒ Clear
constructor
private
Returns a new instance of Clear.
- #rows ⇒ Enumerator private private
Constructor Details
#initialize(interface) ⇒ Clear
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Clear.
22 23 24 |
# File 'lib/vedeu/output/clear.rb', line 22 def initialize(interface) @interface = interface end |
Instance Attribute Details
#interface ⇒ Object (readonly, private)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 43 |
# File 'lib/vedeu/output/clear.rb', line 41 def interface @interface end |
Class Method Details
.call(interface) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Blanks the area defined by the interface.
14 15 16 |
# File 'lib/vedeu/output/clear.rb', line 14 def self.call(interface) new(interface).clear end |
Instance Method Details
#clear ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
For each visible line of the interface, set the foreground and background colours to those specified when the interface was defined, then starting write space characters over the area which the interface occupies.
31 32 33 34 35 36 37 |
# File 'lib/vedeu/output/clear.rb', line 31 def clear Vedeu.log("Clearing view: '#{interface.name}'") rows.inject([colours]) do |line, index| line << interface.origin(index) { ' ' * interface. } end.join end |
#colours ⇒ String (private)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
45 46 47 |
# File 'lib/vedeu/output/clear.rb', line 45 def colours interface.colour.to_s end |
#rows ⇒ Enumerator (private)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
51 52 53 |
# File 'lib/vedeu/output/clear.rb', line 51 def rows interface..times end |