Class: Dashboards::Box

Inherits:
Object
  • Object
show all
Defined in:
lib/dashboards/dsl/box.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#elementsObject (readonly)

Returns the value of attribute elements.



3
4
5
# File 'lib/dashboards/dsl/box.rb', line 3

def elements
  @elements
end

#nameObject (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(data_or_options, options = {})
  @elements << ChangeOverPeriod.new(data_or_options, options)
end

#chart(name, options = {}) ⇒ Object



14
15
16
# File 'lib/dashboards/dsl/box.rb', line 14

def chart(name, options = {})
  @elements << Chart.new(name, options)
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, options = {})
  @elements << Metric.new(name, options)
end

#summary(data_or_options, options = {}) ⇒ Object



22
23
24
# File 'lib/dashboards/dsl/box.rb', line 22

def summary(data_or_options, options = {})
  @elements << Summary.new(data_or_options, options)
end

#table(name, options = {}) ⇒ Object



18
19
20
# File 'lib/dashboards/dsl/box.rb', line 18

def table(name, options = {})
  @elements << Table.new(name, options)
end