Class: Vedeu::Models::Page Private
- Inherits:
-
Object
- Object
- Vedeu::Models::Page
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/vedeu/models/page.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A Page represents an array of Vedeu::Models::Row objects.
Instance Attribute Summary collapse
- #rows ⇒ Array<NilClass|Vedeu::Models::Row> readonly private
Instance Method Summary collapse
- #cell(row_index = nil, cell_index = nil) ⇒ NilClass|void private
- #content ⇒ Array<void> private
-
#each(&block) ⇒ Enumerator
private
Provides iteration over the collection.
- #empty? ⇒ Boolean private
-
#eql?(other) ⇒ Boolean
(also: #==)
private
An object is equal when its values are the same.
-
#initialize(rows = []) ⇒ Vedeu::Models::Page
constructor
private
Returns a new instance of Vedeu::Models::Page.
- #row(index = nil) ⇒ NilClass|Vedeu::Models::Row private
- #size ⇒ Fixnum private
Constructor Details
#initialize(rows = []) ⇒ Vedeu::Models::Page
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Vedeu::Models::Page.
32 33 34 |
# File 'lib/vedeu/models/page.rb', line 32 def initialize(rows = []) @rows = rows || [] end |
Instance Attribute Details
#rows ⇒ Array<NilClass|Vedeu::Models::Row> (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
17 18 19 |
# File 'lib/vedeu/models/page.rb', line 17 def rows @rows end |
Instance Method Details
#cell(row_index = nil, cell_index = nil) ⇒ NilClass|void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
44 45 46 47 48 49 |
# File 'lib/vedeu/models/page.rb', line 44 def cell(row_index = nil, cell_index = nil) return nil if row_index.nil? || cell_index.nil? return nil unless row(row_index) row(row_index)[cell_index] end |
#content ⇒ Array<void>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
37 38 39 |
# File 'lib/vedeu/models/page.rb', line 37 def content rows.flat_map(&:content) end |
#each(&block) ⇒ Enumerator
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Provides iteration over the collection.
55 56 57 |
# File 'lib/vedeu/models/page.rb', line 55 def each(&block) rows.each(&block) end |
#empty? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
60 61 62 |
# File 'lib/vedeu/models/page.rb', line 60 def empty? rows.empty? end |
#eql?(other) ⇒ Boolean Also known as: ==
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
An object is equal when its values are the same.
68 69 70 |
# File 'lib/vedeu/models/page.rb', line 68 def eql?(other) self.class.equal?(other.class) && rows == other.rows end |
#row(index = nil) ⇒ NilClass|Vedeu::Models::Row
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
75 76 77 78 79 |
# File 'lib/vedeu/models/page.rb', line 75 def row(index = nil) return nil if index.nil? rows[index] end |
#size ⇒ Fixnum
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
82 83 84 |
# File 'lib/vedeu/models/page.rb', line 82 def size rows.size end |