class CocRb::League

Public Class Methods

get_LeagueInfo(leagueId:, status:false) click to toggle source

This method gets League Info for a particular league ID.

*Paramter Data Type* => Integer

# File lib/cocRb/league.rb, line 98
       def self.get_LeagueInfo(leagueId:, status:false)
              get
              res = @conn.get("v1/leagues/#{leagueId}")
       if status
              res.status
       else
              val = res.body
              convert = JSON.parse(val)

    end
end
get_LeagueSeasonRank(leagueId:, seasonId:, _limit:false, status:false) click to toggle source

This method gets Season Rank for Legend League, Takes League ID and Season ID as parameter.

*Paramter Data Types* => Integer, String

# File lib/cocRb/league.rb, line 79
      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
              res = @conn.get("v1/leagues/#{leagueId}/seasons/#{seasonId}") do |req|
              req.params[:limit] = _limit if _limit
   end
       if status
              res.status
       else
              val = res.body
              convert = JSON.parse(val)
      end
   end
end
get_LeaguesID(_limit:false, status:false) click to toggle source

This method gets League ID for all the Leagues.

# File lib/cocRb/league.rb, line 41
   def self.get_LeaguesID(_limit:false, status:false)
              get
              res = @conn.get('v1/leagues') do |req|
              req.params[:limit] = _limit if _limit
   end

         if status
              res.status

         else
              val = res.body
              convert = JSON.parse(val)

  end
end
get_Seasons(leagueId:, _limit:false, status:false) click to toggle source

This method gets season Info for Legend League, Takes League ID as a parameter.

Paramter Data Type => Integer

# File lib/cocRb/league.rb, line 59
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|
            req.params[:limit] = _limit if _limit
end

      if status
            res.status
      else
            val = res.body
            convert = JSON.parse(val)
        end
     end
  end
get_WarLeagueId(_limit:false, status:false) click to toggle source

This method gets War League ID.

# File lib/cocRb/league.rb, line 111
def self.get_WarLeagueId(_limit:false, status:false)
         get
         res = @conn.get("v1/warleagues") do |req|
         req.params[:limit] = _limit if _limit
end

   if status
         res.status
   else
         val = res.body
         convert = JSON.parse(val)
    end
end
get_WarLeagueInfo(warLeagueId:, status:false) click to toggle source

This method gets War League Info takes warLeagueId as a paramter.

*Paramter Data Type* => Integer

# File lib/cocRb/league.rb, line 127
def self.get_WarLeagueInfo(warLeagueId:, status:false)
        get
        res = @conn.get("v1/warleagues/#{warLeagueId}")
if status
        res.status
else
        val = res.body
        convert = JSON.parse(val)
       end
   end