Module: Vk::Stats
- Defined in:
- lib/vk/stats.rb
Defined Under Namespace
Classes: Age, City, Country, Period, Sex, SexAge
Constant Summary collapse
- TIME_FORMAT =
'%Y-%m-%d'
Class Method Summary collapse
Class Method Details
.get(options = {}) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/vk/stats.rb', line 20 def get( = {}) [:date_from] = [:date_from].to_date.strftime(TIME_FORMAT) if .key?(:date_from) [:date_to] = [:date_to].to_date.strftime(TIME_FORMAT) if .key?(:date_to) result = loader.request('stats.get', ) result.map { |period| Period.new(period['day'], data: period) } if result end |