Class: Hackmac::Graph::Display::Cell

Inherits:
Struct
  • Object
show all
Defined in:
lib/hackmac/graph/display.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#charObject

Returns the value of attribute char

Returns:

  • (Object)

    the current value of char



5
6
7
# File 'lib/hackmac/graph/display.rb', line 5

def char
  @char
end

#colorObject

Returns the value of attribute color

Returns:

  • (Object)

    the current value of color



5
6
7
# File 'lib/hackmac/graph/display.rb', line 5

def color
  @color
end

#on_colorObject

Returns the value of attribute on_color

Returns:

  • (Object)

    the current value of on_color



5
6
7
# File 'lib/hackmac/graph/display.rb', line 5

def on_color
  @on_color
end

#stylesObject

Returns the value of attribute styles

Returns:

  • (Object)

    the current value of styles



5
6
7
# File 'lib/hackmac/graph/display.rb', line 5

def styles
  @styles
end

Instance Method Details

#==(other) ⇒ Object



6
7
8
# File 'lib/hackmac/graph/display.rb', line 6

def ==(other)
  to_a == other.to_a
end

#to_sObject



10
11
12
13
14
15
16
17
# File 'lib/hackmac/graph/display.rb', line 10

def to_s
  result = +''
  result << ANSI.color(color)
  result << ANSI.on_color(on_color)
  styles.each { |s| result << ANSI.send(s) }
  result << char
  result << ANSI.reset
end