class Wykop::Operations::Rank
Public Class Methods
new(client)
click to toggle source
Documentation: www.wykop.pl/dla-programistow/dokumentacja/#info6_13
# File lib/wykop/operations/rank.rb, line 5 def initialize(client) @client = client @request = Wykop::Operations::Request.new(@client) end
Public Instance Methods
rank_show( p = {} )
click to toggle source
# File lib/wykop/operations/rank.rb, line 10 def rank_show( p = {} ) if ! p.has_key?(:order); p[:order] = 'rank'; end q_url = replace_url({ :banana => 'rank', :potato => 'index', :order => p[:order] }) q_body = Hash.new return @request.execute(q_url, q_body) end
replace_url( p = {} )
click to toggle source
# File lib/wykop/operations/rank.rb, line 17 def replace_url( p = {} ) standard_url = "#{@client.configuration.api_host}/banana/potato/order/order_content/appkey,#{@client.configuration.app_user_key}/userkey,#{@client.user_info['userkey']}" return standard_url.gsub(/banana/, p[:banana]).gsub(/potato/, p[:potato]).gsub(/order_content/, p[:order]) end