Class: Biostars::API::Traffic
- Inherits:
-
Object
- Object
- Biostars::API::Traffic
- Defined in:
- lib/biostars/api/traffic.rb
Overview
Number of post views over the last 60 min filtered by unique IPs.
Instance Attribute Summary collapse
-
#date ⇒ String
readonly
The current date, ISO 8601 format.
-
#post_views_last_60_min ⇒ Fixnum
readonly
Number of post views over the last 60 min filtered by unique IPs.
-
#timestamp ⇒ Fixnum
readonly
Current date unix epoch time format.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Traffic
constructor
Instantiate the Biostars::API::Traffic.
Constructor Details
#initialize(attributes) ⇒ Traffic
Instantiate the Biostars::API::Traffic.
18 19 20 21 22 |
# File 'lib/biostars/api/traffic.rb', line 18 def initialize(attributes) attributes.each do |k,v| instance_variable_set "@#{k}", v unless v.nil? end end |
Instance Attribute Details
#date ⇒ String (readonly)
Returns the current date, ISO 8601 format.
9 10 11 |
# File 'lib/biostars/api/traffic.rb', line 9 def date @date end |
#post_views_last_60_min ⇒ Fixnum (readonly)
Returns number of post views over the last 60 min filtered by unique IPs.
12 13 14 |
# File 'lib/biostars/api/traffic.rb', line 12 def post_views_last_60_min @post_views_last_60_min end |
#timestamp ⇒ Fixnum (readonly)
Returns current date unix epoch time format.
15 16 17 |
# File 'lib/biostars/api/traffic.rb', line 15 def @timestamp end |