Class: Vedeu::Clear
- Inherits:
-
Object
- Object
- Vedeu::Clear
- Defined in:
- lib/vedeu/support/clear.rb
Instance Attribute Summary collapse
-
#interface ⇒ Object
readonly
private
Returns the value of attribute interface.
Class Method Summary collapse
Instance Method Summary collapse
- #clear ⇒ String
- #colours ⇒ String private private
- #initialize(interface) ⇒ Clear constructor
- #rows ⇒ Enumerator private private
Constructor Details
#initialize(interface) ⇒ Clear
12 13 14 |
# File 'lib/vedeu/support/clear.rb', line 12 def initialize(interface) @interface = interface end |
Instance Attribute Details
#interface ⇒ Object (readonly, private)
Returns the value of attribute interface.
25 26 27 |
# File 'lib/vedeu/support/clear.rb', line 25 def interface @interface end |
Class Method Details
.call(interface) ⇒ String
6 7 8 |
# File 'lib/vedeu/support/clear.rb', line 6 def self.call(interface) new(interface).clear end |
Instance Method Details
#clear ⇒ String
17 18 19 20 21 |
# File 'lib/vedeu/support/clear.rb', line 17 def clear 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.
29 30 31 |
# File 'lib/vedeu/support/clear.rb', line 29 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.
35 36 37 |
# File 'lib/vedeu/support/clear.rb', line 35 def rows interface..times end |