Class: Gitter::TableCell

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::NumberHelper
Defined in:
lib/gitter/table.rb

Direct Known Subclasses

TableHeaderCell

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y, content) ⇒ TableCell

Returns a new instance of TableCell.



11
12
13
# File 'lib/gitter/table.rb', line 11

def initialize x, y, content
  @x, @y, @content = x, y, content
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



9
10
11
# File 'lib/gitter/table.rb', line 9

def content
  @content
end

#xObject (readonly)

Returns the value of attribute x.



9
10
11
# File 'lib/gitter/table.rb', line 9

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y.



9
10
11
# File 'lib/gitter/table.rb', line 9

def y
  @y
end

Instance Method Details

#formatted_contentObject



23
24
25
# File 'lib/gitter/table.rb', line 23

def formatted_content
  number_with_delimiter content, delimiter: '.'
end

#header?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/gitter/table.rb', line 19

def header?
  false
end

#html(opts = {}) ⇒ Object



15
16
17
# File 'lib/gitter/table.rb', line 15

def html opts = {}
  Table.tag :td, formatted_content, opts.merge(class: "#{x} #{y}")
end