lib/cocRb/league.rb in cocRb-0.1.4 vs lib/cocRb/league.rb in cocRb-0.1.5
- old
+ new
@@ -35,11 +35,11 @@
puts e
end
end
class League < Settings
-
+ # This method gets League ID for all the Leagues.
def self.get_LeaguesID(_limit:false, status:false)
get
res = @conn.get('v1/leagues') do |req|
req.params[:limit] = _limit if _limit
end
@@ -51,12 +51,14 @@
val = res.body
convert = JSON.parse(val)
end
end
-
-def self.get_Seasons(leagueId:, _limit:false, status:false)
+ # This method gets season Info for Legend League, Takes League ID as a parameter.
+ #
+ # *Paramter Data Type* => _Integer_
+ def self.get_Seasons(leagueId:, _limit:false, status:false)
get
if leagueId != 29000022
puts "Not a valid League id,Seasons are only available for Legend League"
else
res = @conn.get("v1/leagues/#{leagueId}/seasons") do |req|
@@ -69,11 +71,13 @@
val = res.body
convert = JSON.parse(val)
end
end
end
-
+ # This method gets Season Rank for Legend League, Takes League ID and Season ID as parameter.
+ #
+ # *Paramter Data Types* => _Integer_, _String_
def self.get_LeagueSeasonRank(leagueId:, seasonId:, _limit:false, status:false)
get
if leagueId != 29000022
puts "Not a valid League id,Seasons are only available for Legend League"
else
@@ -86,11 +90,13 @@
val = res.body
convert = JSON.parse(val)
end
end
end
-
+ # This method gets League Info for a particular league ID.
+ #
+ # *Paramter Data Type* => _Integer_
def self.get_LeagueInfo(leagueId:, status:false)
get
res = @conn.get("v1/leagues/#{leagueId}")
if status
res.status
@@ -99,11 +105,11 @@
convert = JSON.parse(val)
end
end
-
+ # This method gets War League ID.
def self.get_WarLeagueId(_limit:false, status:false)
get
res = @conn.get("v1/warleagues") do |req|
req.params[:limit] = _limit if _limit
end
@@ -113,10 +119,12 @@
else
val = res.body
convert = JSON.parse(val)
end
end
-
+ # This method gets War League Info takes warLeagueId as a paramter.
+ #
+ # *Paramter Data Type* => _Integer_
def self.get_WarLeagueInfo(warLeagueId:, status:false)
get
res = @conn.get("v1/warleagues/#{warLeagueId}")
if status
res.status