Class: Biostars::API::Traffic

Inherits:
Object
  • Object
show all
Defined in:
lib/biostars/api/traffic.rb

Overview

Number of post views over the last 60 min filtered by unique IPs.

Author:

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dateString (readonly)

Returns the current date, ISO 8601 format.

Returns:

  • (String)

    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_minFixnum (readonly)

Returns number of post views over the last 60 min filtered by unique IPs.

Returns:

  • (Fixnum)

    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

#timestampFixnum (readonly)

Returns current date unix epoch time format.

Returns:

  • (Fixnum)

    current date unix epoch time format.



15
16
17
# File 'lib/biostars/api/traffic.rb', line 15

def timestamp
  @timestamp
end