Class: Stats::Chart
- Inherits:
-
Object
- Object
- Stats::Chart
- Defined in:
- app/models/stats/chart.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
- #dimensions ⇒ Object
-
#initialize(action, dimensions = {}) ⇒ Chart
constructor
A new instance of Chart.
Constructor Details
#initialize(action, dimensions = {}) ⇒ Chart
Returns a new instance of Chart.
5 6 7 8 9 |
# File 'app/models/stats/chart.rb', line 5 def initialize(action, dimensions = {}) @action = action @height = dimensions.fetch(:height) { 250 } @width = dimensions.fetch(:width) { 460 } end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
3 4 5 |
# File 'app/models/stats/chart.rb', line 3 def action @action end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
3 4 5 |
# File 'app/models/stats/chart.rb', line 3 def height @height end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
3 4 5 |
# File 'app/models/stats/chart.rb', line 3 def width @width end |
Instance Method Details
#dimensions ⇒ Object
11 12 13 |
# File 'app/models/stats/chart.rb', line 11 def dimensions "#{width}x#{height}" end |