Class: Tricle::Presenters::Group
- Defined in:
- lib/tricle/presenters/group.rb
Instance Attribute Summary collapse
-
#metrics ⇒ Object
readonly
Returns the value of attribute metrics.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #add_metric(klass, opts = {}) ⇒ Object
-
#initialize(title = nil) ⇒ Group
constructor
A new instance of Group.
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
#metrics ⇒ Object (readonly)
Returns the value of attribute metrics.
6 7 8 |
# File 'lib/tricle/presenters/group.rb', line 6 def metrics @metrics end |
#title ⇒ Object (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 |