Class: Vedeu::Buffers::View Private
- Inherits:
-
Object
- Object
- Vedeu::Buffers::View
- Defined in:
- lib/vedeu/buffers/view.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.
Allow the creation of individual named buffers for views.
Instance Method Summary collapse
- #border ⇒ Vedeu::Borders::Border private private
- #buffer ⇒ Vedeu::Buffers::Empty private private
- #current ⇒ Vedeu::Buffers::Empty private private
- #current_reset! ⇒ Vedeu::Buffers::Empty private private
-
#defaults ⇒ Hash<Symbol => NilClass|String|Symbol]
private
private
Hash<Symbol => NilClass|String|Symbol].
- #dirty ⇒ Vedeu::Buffers::Empty private private
- #dirty_reset! ⇒ Vedeu::Buffers::Empty private private
-
#initialize(attributes = {}) ⇒ Vedeu::Buffers::View
constructor
private
Returns a new instance of Vedeu::Buffers::View.
Constructor Details
#initialize(attributes = {}) ⇒ Vedeu::Buffers::View
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 Vedeu::Buffers::View.
16 17 18 19 20 |
# File 'lib/vedeu/buffers/view.rb', line 16 def initialize(attributes = {}) defaults.merge!(attributes).each do |key, value| instance_variable_set("@#{key}", value || defaults.fetch(key)) end end |
Instance Method Details
#border ⇒ Vedeu::Borders::Border (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.
25 26 27 |
# File 'lib/vedeu/buffers/view.rb', line 25 def border Vedeu.borders.by_name(name) end |
#buffer ⇒ Vedeu::Buffers::Empty (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.
30 31 32 33 34 |
# File 'lib/vedeu/buffers/view.rb', line 30 def buffer @_buffer ||= Vedeu::Buffers::Empty.new(height: border.height, name: name, width: border.width).buffer end |
#current ⇒ Vedeu::Buffers::Empty (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.
37 38 39 |
# File 'lib/vedeu/buffers/view.rb', line 37 def current @current ||= buffer end |
#current_reset! ⇒ Vedeu::Buffers::Empty (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.
42 43 44 |
# File 'lib/vedeu/buffers/view.rb', line 42 def current_reset! @current = buffer end |
#defaults ⇒ Hash<Symbol => NilClass|String|Symbol] (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.
Returns Hash<Symbol => NilClass|String|Symbol].
47 48 49 50 51 |
# File 'lib/vedeu/buffers/view.rb', line 47 def defaults { name: '' } end |
#dirty ⇒ Vedeu::Buffers::Empty (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.
54 55 56 |
# File 'lib/vedeu/buffers/view.rb', line 54 def dirty @dirty ||= buffer end |
#dirty_reset! ⇒ Vedeu::Buffers::Empty (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.
59 60 61 |
# File 'lib/vedeu/buffers/view.rb', line 59 def dirty_reset! @dirty = buffer end |