Class: Dashboards::Dashboard

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ Dashboard

Returns a new instance of Dashboard.



7
8
9
10
11
# File 'lib/dashboards/dsl/dashboard.rb', line 7

def initialize(name, options = {})
  @name = name
  @slug = options[:slug] || name.parameterize
  @boxes = []
end

Instance Attribute Details

#boxesObject (readonly)

Returns the value of attribute boxes.



5
6
7
# File 'lib/dashboards/dsl/dashboard.rb', line 5

def boxes
  @boxes
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/dashboards/dsl/dashboard.rb', line 5

def name
  @name
end

#slugObject (readonly)

Returns the value of attribute slug.



5
6
7
# File 'lib/dashboards/dsl/dashboard.rb', line 5

def slug
  @slug
end

Instance Method Details

#box(name, &block) ⇒ Object



13
14
15
# File 'lib/dashboards/dsl/dashboard.rb', line 13

def box(name, &block)
  @boxes << Box.new(name).tap { |b| b.instance_eval(&block) }
end