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.
89 90 91 92 93 94 |
# File 'lib/rerout/models.rb', line 89 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.
87 88 89 |
# File 'lib/rerout/models.rb', line 87 def clicks @clicks end |
#day ⇒ Object (readonly)
Returns the value of attribute day.
87 88 89 |
# File 'lib/rerout/models.rb', line 87 def day @day end |
#qr_scans ⇒ Object (readonly)
Returns the value of attribute qr_scans.
87 88 89 |
# File 'lib/rerout/models.rb', line 87 def qr_scans @qr_scans end |
Class Method Details
.from_hash(hash) ⇒ Object
96 97 98 |
# File 'lib/rerout/models.rb', line 96 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?
104 105 106 107 |
# File 'lib/rerout/models.rb', line 104 def ==(other) other.is_a?(DailyClicksPoint) && other.day == day && other.clicks == clicks && other.qr_scans == qr_scans end |
#hash ⇒ Object
110 111 112 |
# File 'lib/rerout/models.rb', line 110 def hash [self.class, day, clicks, qr_scans].hash end |
#to_h ⇒ Object
100 101 102 |
# File 'lib/rerout/models.rb', line 100 def to_h { day: day, clicks: clicks, qr_scans: qr_scans } end |