Class: Vedeu::Buffers::Clear Private

Inherits:
Object
  • Object
show all
Includes:
Repositories::Defaults
Defined in:
lib/vedeu/buffers/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.

Provides a grid of Vedeu::Cells::Clear objects at the given height and width.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Repositories::Defaults

#initialize, #validate

Methods included from Common

#absent?, #array?, #boolean, #boolean?, #empty_value?, #escape?, #falsy?, #hash?, #line_model?, #numeric?, #positionable?, #present?, #snake_case, #stream_model?, #string?, #symbol?, #truthy?, #view_model?

Instance Attribute Details

#nameNilClass|String|Symbol (readonly)

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:

  • (NilClass|String|Symbol)


18
19
20
# File 'lib/vedeu/buffers/clear.rb', line 18

def name
  @name
end

Instance Method Details

#bufferArray<Array<Vedeu::Cells::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:



21
22
23
# File 'lib/vedeu/buffers/clear.rb', line 21

def buffer
  @buffer ||= clear
end

#clearArray<Array<Vedeu::Cells::Clear>> (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:



52
53
54
55
56
57
58
# File 'lib/vedeu/buffers/clear.rb', line 52

def clear
  Array.new(height) do
    Array.new(width) do
      Vedeu::Cells::Clear.new(colour: interface.colour, name: name)
    end
  end
end

#defaultsHash<Symbol => void> (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.

The default options/attributes for a new instance of this class.

Returns:

  • (Hash<Symbol => void>)


43
44
45
46
47
48
49
# File 'lib/vedeu/buffers/clear.rb', line 43

def defaults
  {
    height: Vedeu.height,
    name:   nil,
    width:  Vedeu.width,
  }
end

#heightFixnum

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:

  • (Fixnum)


26
27
28
# File 'lib/vedeu/buffers/clear.rb', line 26

def height
  @height + 1
end

#interfaceVedeu::Interfaces::Interface (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 the named interface/view from the interfaces repository.



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

def interface
  @_interface ||= Vedeu.interfaces.by_name(name)
end

#widthFixnum

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:

  • (Fixnum)


31
32
33
# File 'lib/vedeu/buffers/clear.rb', line 31

def width
  @width + 1
end