Class: Deep::Hash::Struct::Dashboard
- Inherits:
-
Object
- Object
- Deep::Hash::Struct::Dashboard
- Includes:
- PP::Dashboard
- Defined in:
- lib/deep/hash/struct/dashboard.rb,
lib/deep/hash/struct/dashboard/table.rb,
lib/deep/hash/struct/dashboard/table/row.rb
Defined Under Namespace
Classes: Table
Instance Attribute Summary collapse
-
#tables ⇒ Object
Returns the value of attribute tables.
Instance Method Summary collapse
- #add_table(options = {}) ⇒ Object
- #each ⇒ Object
-
#initialize ⇒ Dashboard
constructor
A new instance of Dashboard.
- #map ⇒ Object (also: #collect)
Methods included from PP::Dashboard
Constructor Details
#initialize ⇒ Dashboard
Returns a new instance of Dashboard.
11 12 13 |
# File 'lib/deep/hash/struct/dashboard.rb', line 11 def initialize self.tables = [] end |
Instance Attribute Details
#tables ⇒ Object
Returns the value of attribute tables.
9 10 11 |
# File 'lib/deep/hash/struct/dashboard.rb', line 9 def tables @tables end |
Instance Method Details
#add_table(options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/deep/hash/struct/dashboard.rb', line 15 def add_table( = {}) tables << if block_given? yield table = Table.new() table.parse! table else Table.new end end |
#each ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/deep/hash/struct/dashboard.rb', line 25 def each if block_given? tables.each do |table| yield table end else tables.each end end |
#map ⇒ Object Also known as: collect
35 36 37 38 39 40 41 42 43 |
# File 'lib/deep/hash/struct/dashboard.rb', line 35 def map if block_given? tables.map do |table| yield table end else tables.map end end |