Class: RubyCurses::Chunks::Chunk

Inherits:
Object
  • Object
show all
Defined in:
lib/rbcurse/core/include/chunk.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(color, text, attrib) ⇒ Chunk

Returns a new instance of Chunk.



22
23
24
25
26
27
# File 'lib/rbcurse/core/include/chunk.rb', line 22

def initialize color, text, attrib
  @chunk = [ color, text, attrib ]
  #@color = color
  #@text  = text
  #@attrib = attrib
end

Instance Attribute Details

#chunkObject (readonly)

color_pair of associated text text to print attribute of associated text attr_accessor :color, :text, :attrib



20
21
22
# File 'lib/rbcurse/core/include/chunk.rb', line 20

def chunk
  @chunk
end

Instance Method Details

#attribObject



34
35
36
# File 'lib/rbcurse/core/include/chunk.rb', line 34

def attrib
  @chunk[2]
end

#colorObject



28
29
30
# File 'lib/rbcurse/core/include/chunk.rb', line 28

def color
  @chunk[0]
end

#textObject



31
32
33
# File 'lib/rbcurse/core/include/chunk.rb', line 31

def text
  @chunk[1]
end