Class: Vedeu::Buffers::View Private

Inherits:
Object
  • Object
show all
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

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.

Options Hash (attributes):

  • name (NilClass|String|Symbol)


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

#bufferVedeu::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
35
# File 'lib/vedeu/buffers/view.rb', line 30

def buffer
  @_buffer ||= Vedeu::Buffers::Empty
                 .new(height: geometry.bordered_height,
                      name:   name,
                      width:  geometry.bordered_width).buffer
end

#currentVedeu::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.



38
39
40
# File 'lib/vedeu/buffers/view.rb', line 38

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.



43
44
45
# File 'lib/vedeu/buffers/view.rb', line 43

def current_reset!
  @current = buffer
end

#defaultsHash<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].



48
49
50
51
52
# File 'lib/vedeu/buffers/view.rb', line 48

def defaults
  {
    name: ''
  }
end

#dirtyVedeu::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.



55
56
57
# File 'lib/vedeu/buffers/view.rb', line 55

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.



60
61
62
# File 'lib/vedeu/buffers/view.rb', line 60

def dirty_reset!
  @dirty = buffer
end

#geometryVedeu::Geometry::Geometry (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 geometry
  Vedeu.geometries.by_name(name)
end