Class: Vk::API::Stats

Inherits:
Schema::Namespace show all
Defined in:
lib/vk/api/methods.rb,
lib/vk/api/objects.rb,
lib/vk/api/responses.rb,
lib/vk/api/stats/period.rb,
lib/vk/api/stats/methods/get.rb,
lib/vk/api/stats/wallpost_stat.rb,
lib/vk/api/stats/methods/track_visitor.rb,
lib/vk/api/stats/methods/get_post_reach.rb,
lib/vk/api/stats/responses/get_response.rb,
lib/vk/api/stats/responses/track_visitor_response.rb,
lib/vk/api/stats/responses/get_post_reach_response.rb

Defined Under Namespace

Modules: Methods, Responses Classes: Period, WallpostStat

Instance Attribute Summary

Attributes inherited from Schema::Namespace

#client

DSL collapse

Methods inherited from Schema::Namespace

#call, #initialize

Constructor Details

This class inherits a constructor from Vk::Schema::Namespace

Instance Method Details

#get(arguments = {}) ⇒ Vk::API::Stats::Responses::GetResponse

Returns statistics of a community or an application.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :group_id (Integer)

    Community ID.

  • :app_id (Integer)

    Application ID.

  • :date_from (String)

    Latest datestamp (in Unix time) of statistics to return.

  • :date_to (String)

    End datestamp (in Unix time) of statistics to return.

Returns:

See Also:



5199
5200
5201
5202
5203
5204
5205
# File 'lib/vk/api/methods.rb', line 5199

def get(arguments = {})
  require "vk/api/stats/methods/get"
  method = Methods::Get.new(arguments)
  response = method.call(@client)
  require "vk/api/stats/responses/get_response"
  Responses::GetResponse.new(response.deep_symbolize_keys)
end

#get_post_reach(arguments = {}) ⇒ Vk::API::Stats::Responses::GetPostReachResponse

Returns stats for a wall post.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :owner_id (Integer)

    post owner community id. Specify with "-" sign.

  • :post_id (Integer)

    wall post id. Note that stats are available only for '300' last (newest) posts on a community wall.

Returns:

See Also:



5221
5222
5223
5224
5225
5226
5227
# File 'lib/vk/api/methods.rb', line 5221

def get_post_reach(arguments = {})
  require "vk/api/stats/methods/get_post_reach"
  method = Methods::GetPostReach.new(arguments)
  response = method.call(@client)
  require "vk/api/stats/responses/get_post_reach_response"
  Responses::GetPostReachResponse.new(response.deep_symbolize_keys)
end

#track_visitor(arguments = {}) ⇒ Vk::API::Stats::Responses::TrackVisitorResponse



5209
5210
5211
5212
5213
5214
5215
# File 'lib/vk/api/methods.rb', line 5209

def track_visitor(arguments = {})
  require "vk/api/stats/methods/track_visitor"
  method = Methods::TrackVisitor.new(arguments)
  response = method.call(@client)
  require "vk/api/stats/responses/track_visitor_response"
  Responses::TrackVisitorResponse.new(response.deep_symbolize_keys)
end