tracks/app/models/stats/chart.rb

16 lines
307 B
Ruby
Raw Normal View History

module Stats
class Chart
attr_reader :action, :height, :width
2020-10-10 02:27:42 +03:00
def initialize(action, dimensions = {})
@action = action
@height = dimensions.fetch(:height) { 250 }
@width = dimensions.fetch(:width) { 460 }
end
def dimensions
"#{width}x#{height}"
end
end
end