Class: CocRb::Location

Inherits:
Settings show all
Defined in:
lib/cocRb/location.rb

Class Method Summary collapse

Methods inherited from Settings

get

Class Method Details

.get_LocationId(_limit: false, status: false) ⇒ Object

This method will get all the location ID including country name and country code.



40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/cocRb/location.rb', line 40

def self.get_LocationId(_limit:false, status:false)
            get
            res = @conn.get("v1/locations") do |req|
            req.params[:limit] = _limit if _limit
    end
       if status
             res.status
       else
             val = res.body
             convert = JSON.parse(val)

  end
end

.get_LocationInfo(locationId:, status: false) ⇒ Object

This method gets detailed location information, takes Location ID as a paramter.

Paramter Data Type => Integer



56
57
58
59
60
61
62
63
64
65
# File 'lib/cocRb/location.rb', line 56

def self.get_LocationInfo(locationId:, status:false)
             get
             res = @conn.get("v1/locations/#{locationId}")
       if status
              res.status
       else
              val = res.body
              convert = JSON.parse(val)
  end
end

.get_LocationRankClan(locationId:, _limit: false, status: false) ⇒ Object

This method gets all the Ranked clans for a particular Location, Takes Location id as a paramter.

Paramter Data Type => Integer



70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/cocRb/location.rb', line 70

def self.get_LocationRankClan(locationId:, _limit:false, status:false)
              get
              res = @conn.get("v1/locations/#{locationId}/rankings/clans") do |req|
              req.params[:limit] = _limit if _limit
  end
       if status
              res.status
       else
              val = res.body
              convert = JSON.parse(val)
  end
end

.get_LocationRankClanVersus(locationId:, _limit: false, status: false) ⇒ Object

This method gets all the Ranked clans for Builder Base Clan Versus Trophies, Takes Location id as a paramter.

Paramter Data Type => Integer



100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/cocRb/location.rb', line 100

def self.get_LocationRankClanVersus(locationId:, _limit:false, status:false)
              get
              res = @conn.get("v1/locations/#{locationId}/rankings/clans-versus") do |req|
              req.params[:limit] = _limit if _limit
  end
      if status
              res.status
      else
              val = res.body
              convert = JSON.parse(val)
  end
end

.get_LocationRankPlayer(locationId:, _limit: false, status: false) ⇒ Object

This method gets all the Ranked palyers for a particular Location, Takes Location id as a paramter.

Paramter Data Type => Integer



85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/cocRb/location.rb', line 85

def self.get_LocationRankPlayer(locationId:, _limit:false, status:false)
              get
              res = @conn.get("v1/locations/#{locationId}/rankings/players") do |req|
              req.params[:limit] = _limit if _limit
  end
        if status
              res.status
        else
              val = res.body
              convert = JSON.parse(val)
  end
end

.get_LocationRankPlayerVersus(locationId:, _limit: false, status: false) ⇒ Object

This method gets all the Ranked players for Builder Base Player Versus Trophies, Takes Location id as a paramter.

Paramter Data Type => Integer



115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/cocRb/location.rb', line 115

def self.get_LocationRankPlayerVersus(locationId:, _limit:false, status:false)
       get
       res = @conn.get("v1/locations/#{locationId}/rankings/players-versus") do |req|
       req.params[:limit] = _limit if _limit
   end
     if status
       res.status
     else
       val = res.body
       convert = JSON.parse(val)
  end
end