Class: Echoes::Cell

Inherits:
Object
  • Object
show all
Defined in:
lib/echoes/cell.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(char = " ", fg: nil, bg: nil, bold: false, underline: false, inverse: false, width: 1) ⇒ Cell

Returns a new instance of Cell.



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/echoes/cell.rb', line 7

def initialize(char = " ", fg: nil, bg: nil, bold: false, underline: false, inverse: false, width: 1)
  @char = char
  @fg = fg
  @bg = bg
  @bold = bold
  @italic = false
  @underline = underline
  @inverse = inverse
  @faint = false
  @strikethrough = false
  @width = width
end

Instance Attribute Details

#bgObject

Returns the value of attribute bg.



5
6
7
# File 'lib/echoes/cell.rb', line 5

def bg
  @bg
end

Returns the value of attribute blink.



5
6
7
# File 'lib/echoes/cell.rb', line 5

def blink
  @blink
end

#boldObject

Returns the value of attribute bold.



5
6
7
# File 'lib/echoes/cell.rb', line 5

def bold
  @bold
end

#charObject

Returns the value of attribute char.



5
6
7
# File 'lib/echoes/cell.rb', line 5

def char
  @char
end

#concealedObject

Returns the value of attribute concealed.



5
6
7
# File 'lib/echoes/cell.rb', line 5

def concealed
  @concealed
end

#faintObject

Returns the value of attribute faint.



5
6
7
# File 'lib/echoes/cell.rb', line 5

def faint
  @faint
end

#fgObject

Returns the value of attribute fg.



5
6
7
# File 'lib/echoes/cell.rb', line 5

def fg
  @fg
end

Returns the value of attribute hyperlink.



5
6
7
# File 'lib/echoes/cell.rb', line 5

def hyperlink
  @hyperlink
end

#inverseObject

Returns the value of attribute inverse.



5
6
7
# File 'lib/echoes/cell.rb', line 5

def inverse
  @inverse
end

#italicObject

Returns the value of attribute italic.



5
6
7
# File 'lib/echoes/cell.rb', line 5

def italic
  @italic
end

#multicellObject

Returns the value of attribute multicell.



5
6
7
# File 'lib/echoes/cell.rb', line 5

def multicell
  @multicell
end

#strikethroughObject

Returns the value of attribute strikethrough.



5
6
7
# File 'lib/echoes/cell.rb', line 5

def strikethrough
  @strikethrough
end

#underlineObject

Returns the value of attribute underline.



5
6
7
# File 'lib/echoes/cell.rb', line 5

def underline
  @underline
end

#underline_colorObject

Returns the value of attribute underline_color.



5
6
7
# File 'lib/echoes/cell.rb', line 5

def underline_color
  @underline_color
end

#widthObject

Returns the value of attribute width.



5
6
7
# File 'lib/echoes/cell.rb', line 5

def width
  @width
end

Instance Method Details

#copy_from(other) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/echoes/cell.rb', line 38

def copy_from(other)
  @char = other.char
  @fg = other.fg
  @bg = other.bg
  @bold = other.bold
  @italic = other.italic
  @underline = other.underline
  @underline_color = other.underline_color
  @inverse = other.inverse
  @faint = other.faint
  @strikethrough = other.strikethrough
  @blink = other.blink
  @concealed = other.concealed
  @hyperlink = other.hyperlink
end

#reset!Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/echoes/cell.rb', line 20

def reset!
  @char = " "
  @fg = nil
  @bg = nil
  @bold = false
  @italic = false
  @underline = false
  @inverse = false
  @faint = false
  @strikethrough = false
  @blink = false
  @concealed = false
  @width = 1
  @multicell = nil
  @hyperlink = nil
  @underline_color = nil
end