Class: Tricle::Presenters::Group

Inherits:
Section
  • Object
show all
Defined in:
lib/tricle/presenters/group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title = nil) ⇒ Group

Returns a new instance of Group.



8
9
10
11
# File 'lib/tricle/presenters/group.rb', line 8

def initialize(title=nil)
  @title = title
  @metrics = []
end

Instance Attribute Details

#metricsObject (readonly)

Returns the value of attribute metrics.



6
7
8
# File 'lib/tricle/presenters/group.rb', line 6

def metrics
  @metrics
end

#titleObject (readonly)

Returns the value of attribute title.



6
7
8
# File 'lib/tricle/presenters/group.rb', line 6

def title
  @title
end

Instance Method Details

#add_metric(klass, opts = {}) ⇒ Object



13
14
15
# File 'lib/tricle/presenters/group.rb', line 13

def add_metric(klass, opts = {})
  self.metrics << klass.new(opts)
end