Class: Arrolio::Content::Table::Row

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/arrolio/content/table.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cells, min_height: 0.0) ⇒ Row

Returns a new instance of Row.



65
66
67
68
69
# File 'lib/arrolio/content/table.rb', line 65

def initialize(cells, min_height: 0.0)
  @cells = Array(cells).freeze
  @min_height = min_height.to_f.freeze
  freeze
end

Instance Attribute Details

#cellsObject (readonly)

Returns the value of attribute cells.



63
64
65
# File 'lib/arrolio/content/table.rb', line 63

def cells
  @cells
end

#min_heightObject (readonly)

Returns the value of attribute min_height.



63
64
65
# File 'lib/arrolio/content/table.rb', line 63

def min_height
  @min_height
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



79
80
81
82
# File 'lib/arrolio/content/table.rb', line 79

def ==(other)
  other.is_a?(self.class) && cells == other.cells &&
    min_height == other.min_height
end

#each(&block) ⇒ Object



71
72
73
# File 'lib/arrolio/content/table.rb', line 71

def each(&block)
  @cells.each(&block)
end

#hashObject



86
87
88
# File 'lib/arrolio/content/table.rb', line 86

def hash
  [self.class, cells, min_height].hash
end

#lengthObject



75
76
77
# File 'lib/arrolio/content/table.rb', line 75

def length
  @cells.length
end