Class: PlataformaSocial::Ranking::Custom
- Inherits:
-
PlataformaSocial::Ranking
- Object
- PlataformaSocial::Ranking
- PlataformaSocial::Ranking::Custom
- Defined in:
- lib/plataforma_social/ranking/custom.rb
Instance Method Summary collapse
-
#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 }.
-
#initialize ⇒ Custom
constructor
A new instance of Custom.
Methods inherited from PlataformaSocial::Ranking
#create, #destroy, #destroy_all, #friends, socialp_route, #window
Constructor Details
#initialize ⇒ Custom
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 = {} .symbolize_keys! verify_if_has_all_required_parameters [{ :friends => :user_reference }, :start_date, :end_date], get_request "/users/ranking", { :start_date => [:start_date], :end_date => [:end_date], :friends => [:friends], :limit => [:limit], :reference => [:user_reference], :page => [:page] } rescue => e return e.to_s end |