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) ⇒ Row

Returns a new instance of Row.



58
59
60
61
# File 'lib/arrolio/content/table.rb', line 58

def initialize(cells)
  @cells = Array(cells).freeze
  freeze
end

Instance Attribute Details

#cellsObject (readonly)

Returns the value of attribute cells.



56
57
58
# File 'lib/arrolio/content/table.rb', line 56

def cells
  @cells
end

Instance Method Details

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



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

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

#each(&block) ⇒ Object



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

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

#hashObject



77
78
79
# File 'lib/arrolio/content/table.rb', line 77

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

#lengthObject



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

def length
  @cells.length
end