Class: AfterTheDeadline::Metrics
- Inherits:
-
Object
- Object
- AfterTheDeadline::Metrics
- Defined in:
- lib/merimee/after_the_deadline.rb
Instance Attribute Summary collapse
-
#grammer ⇒ Object
readonly
Returns the value of attribute grammer.
-
#spell ⇒ Object
readonly
Returns the value of attribute spell.
-
#stats ⇒ Object
readonly
Returns the value of attribute stats.
-
#style ⇒ Object
readonly
Returns the value of attribute style.
Instance Method Summary collapse
-
#initialize(array) ⇒ Metrics
constructor
A new instance of Metrics.
Constructor Details
#initialize(array) ⇒ Metrics
Returns a new instance of Metrics.
85 86 87 88 89 90 91 92 93 94 |
# File 'lib/merimee/after_the_deadline.rb', line 85 def initialize(array) unless array.kind_of?(Array) && array.all? {|i| i.kind_of?(Hash) } raise "#{self.class} must be initialized with an Array of Hashes" end self.spell, self.grammer, self.stats, self.style = {}, {}, {}, {} array.each do |metric| self.send(metric['type'])[metric['key']] = metric['value'] end end |
Instance Attribute Details
#grammer ⇒ Object
Returns the value of attribute grammer.
83 84 85 |
# File 'lib/merimee/after_the_deadline.rb', line 83 def grammer @grammer end |
#spell ⇒ Object
Returns the value of attribute spell.
83 84 85 |
# File 'lib/merimee/after_the_deadline.rb', line 83 def spell @spell end |
#stats ⇒ Object
Returns the value of attribute stats.
83 84 85 |
# File 'lib/merimee/after_the_deadline.rb', line 83 def stats @stats end |
#style ⇒ Object
Returns the value of attribute style.
83 84 85 |
# File 'lib/merimee/after_the_deadline.rb', line 83 def style @style end |