Class: Rerout::Models::DailyClicksPoint
- Inherits:
-
Object
- Object
- Rerout::Models::DailyClicksPoint
- Defined in:
- lib/rerout/models.rb
Overview
One day in a ‘daily` time-series.
Instance Attribute Summary collapse
-
#clicks ⇒ Object
readonly
Returns the value of attribute clicks.
-
#day ⇒ Object
readonly
Returns the value of attribute day.
-
#qr_scans ⇒ Object
readonly
Returns the value of attribute qr_scans.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(day:, clicks:, qr_scans:) ⇒ DailyClicksPoint
constructor
A new instance of DailyClicksPoint.
- #to_h ⇒ Object
Constructor Details
#initialize(day:, clicks:, qr_scans:) ⇒ DailyClicksPoint
Returns a new instance of DailyClicksPoint.
282 283 284 285 286 287 |
# File 'lib/rerout/models.rb', line 282 def initialize(day:, clicks:, qr_scans:) @day = day @clicks = clicks @qr_scans = qr_scans freeze end |
Instance Attribute Details
#clicks ⇒ Object (readonly)
Returns the value of attribute clicks.
280 281 282 |
# File 'lib/rerout/models.rb', line 280 def clicks @clicks end |
#day ⇒ Object (readonly)
Returns the value of attribute day.
280 281 282 |
# File 'lib/rerout/models.rb', line 280 def day @day end |
#qr_scans ⇒ Object (readonly)
Returns the value of attribute qr_scans.
280 281 282 |
# File 'lib/rerout/models.rb', line 280 def qr_scans @qr_scans end |
Class Method Details
.from_hash(hash) ⇒ Object
289 290 291 |
# File 'lib/rerout/models.rb', line 289 def self.from_hash(hash) new(day: hash['day'], clicks: hash['clicks'], qr_scans: hash['qr_scans']) end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
297 298 299 300 |
# File 'lib/rerout/models.rb', line 297 def ==(other) other.is_a?(DailyClicksPoint) && other.day == day && other.clicks == clicks && other.qr_scans == qr_scans end |
#hash ⇒ Object
303 304 305 |
# File 'lib/rerout/models.rb', line 303 def hash [self.class, day, clicks, qr_scans].hash end |
#to_h ⇒ Object
293 294 295 |
# File 'lib/rerout/models.rb', line 293 def to_h { day: day, clicks: clicks, qr_scans: qr_scans } end |