Class: Vedeu::Buffers::Empty Private

Inherits:
Object
  • Object
show all
Includes:
Repositories::Defaults
Defined in:
lib/vedeu/buffers/empty.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::Empty 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/empty.rb', line 18

def name
  @name
end

#xFixnum (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:

  • (Fixnum)


22
23
24
# File 'lib/vedeu/buffers/empty.rb', line 22

def x
  @x
end

#yFixnum (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:

  • (Fixnum)


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

def y
  @y
end

Instance Method Details

#bufferArray<Array<Vedeu::Cells::Empty>>

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:



29
30
31
# File 'lib/vedeu/buffers/empty.rb', line 29

def buffer
  @buffer ||= empty
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>)


46
47
48
49
50
51
52
53
54
# File 'lib/vedeu/buffers/empty.rb', line 46

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

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

Returns:



57
58
59
60
61
62
63
# File 'lib/vedeu/buffers/empty.rb', line 57

def empty
  Array.new(height) do
    Array.new(width) do
      Vedeu::Cells::Empty.new(name: name)
    end
  end
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)


34
35
36
# File 'lib/vedeu/buffers/empty.rb', line 34

def height
  @height + 1
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)


39
40
41
# File 'lib/vedeu/buffers/empty.rb', line 39

def width
  @width + 1
end