Class: PlataformaSocial::Ranking::Custom

Inherits:
PlataformaSocial::Ranking show all
Defined in:
lib/plataforma_social/ranking/custom.rb

Instance Method Summary collapse

Methods inherited from PlataformaSocial::Ranking

#create, #destroy, #destroy_all, #friends, socialp_route, #window

Constructor Details

#initializeCustom

Returns a new instance of Custom.



4
5
6
# File 'lib/plataforma_social/ranking/custom.rb', line 4

def initialize
  
end

Instance Method Details

#get(options = {}) ⇒ Object

Método para retornar o ranking do app filtrado por uma data customizada Esse método aceita como parâmetros: options =

:start_date => DATA_INICIO_DO_RANKING, <- Obrigatório
:end_date => DATA_FIM_DO_RANKING, <- Obrigatório
:user_reference => REFERENCIA_DO_USUARIO, <- Obrigatório caso seja passado o parâmetro friends sendo true
:friends => SE_IREMOS_PEGAR_OS_AMIGOS_DO_USUARIO_EM_QUESTAO_OU_NAO(Boolean),
:limit => NUMERO_MAXIMO_DE_REGISTROS_A_SEREM_RETORNADOS,
:page =>  PAGINA_A_SER_RETORNADA_NA_PAGINACAO



19
20
21
22
23
24
25
# File 'lib/plataforma_social/ranking/custom.rb', line 19

def get options = {}
  options.symbolize_keys!
  verify_if_has_all_required_parameters [{ :friends => :user_reference }, :start_date, :end_date], options
  get_request "/users/ranking", { :start_date => options[:start_date], :end_date => options[:end_date], :friends => options[:friends], :limit => options[:limit], :reference => options[:user_reference], :page => options[:page] }
rescue => e
  return e.to_s
end