Class: Dashboards::Box
- Inherits:
-
Object
- Object
- Dashboards::Box
- Defined in:
- lib/dashboards/dsl/box.rb
Instance Attribute Summary collapse
-
#elements ⇒ Object
readonly
Returns the value of attribute elements.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #change_over_period(data_or_options, options = {}) ⇒ Object
- #chart(name, options = {}) ⇒ Object
- #custom(&block) ⇒ Object
-
#initialize(name) ⇒ Box
constructor
A new instance of Box.
- #metric(name, options = {}) ⇒ Object
- #summary(data_or_options, options = {}) ⇒ Object
- #table(name, options = {}) ⇒ Object
Constructor Details
#initialize(name) ⇒ Box
Returns a new instance of Box.
5 6 7 8 |
# File 'lib/dashboards/dsl/box.rb', line 5 def initialize(name) @name = name @elements = [] end |
Instance Attribute Details
#elements ⇒ Object (readonly)
Returns the value of attribute elements.
3 4 5 |
# File 'lib/dashboards/dsl/box.rb', line 3 def elements @elements end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/dashboards/dsl/box.rb', line 3 def name @name end |
Instance Method Details
#change_over_period(data_or_options, options = {}) ⇒ Object
30 31 32 |
# File 'lib/dashboards/dsl/box.rb', line 30 def change_over_period(, = {}) @elements << ChangeOverPeriod.new(, ) end |
#chart(name, options = {}) ⇒ Object
14 15 16 |
# File 'lib/dashboards/dsl/box.rb', line 14 def chart(name, = {}) @elements << Chart.new(name, ) end |
#custom(&block) ⇒ Object
26 27 28 |
# File 'lib/dashboards/dsl/box.rb', line 26 def custom(&block) @elements << CustomElement.new(block) end |
#metric(name, options = {}) ⇒ Object
10 11 12 |
# File 'lib/dashboards/dsl/box.rb', line 10 def metric(name, = {}) @elements << Metric.new(name, ) end |