Class: Biostars::API::Traffic
- Inherits:
-
Object
- Object
- Biostars::API::Traffic
- Defined in:
- lib/biostars/api/traffic.rb
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
A new instance of Traffic.
Constructor Details
#initialize(attributes) ⇒ Traffic
Returns a new instance of Traffic.
14 15 16 17 18 |
# File 'lib/biostars/api/traffic.rb', line 14 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.
6 7 8 |
# File 'lib/biostars/api/traffic.rb', line 6 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.
9 10 11 |
# File 'lib/biostars/api/traffic.rb', line 9 def post_views_last_60_min @post_views_last_60_min end |
#timestamp ⇒ Fixnum (readonly)
Returns current date unix epoch time format.
12 13 14 |
# File 'lib/biostars/api/traffic.rb', line 12 def @timestamp end |