Class: CLIENT
- Inherits:
-
Object
- Object
- CLIENT
- Defined in:
- lib/SWGOH/API/CLIENT/client.rb
Overview
The CLIENT class makes requests to api.swgoh.api
Instance Attribute Summary collapse
-
#access_token ⇒ Object
writeonly
Sets the attribute access_token.
-
#requester ⇒ Object
writeonly
Sets the attribute requester.
Instance Method Summary collapse
- #abilities(params = {}) ⇒ JSON || nil
- #authorize(username, password) ⇒ String | nil
- #authorized? ⇒ Boolean
- #battle_environments(params = {}) ⇒ JSON || nil
- #battle_targeting_rules(params = {}) ⇒ JSON || nil
- #battles(params = {}) ⇒ JSON || nil
- #categories(params = {}) ⇒ JSON || nil
- #challenge_styles(params = {}) ⇒ JSON || nil
- #challenges(params = {}) ⇒ JSON || nil
- #effects(params = {}) ⇒ JSON || nil
- #environment_collections(params = {}) ⇒ JSON || nil
- #equipment(params = {}) ⇒ JSON || nil
- #event_samples(params = {}) ⇒ JSON || nil
- #events(params = {}) ⇒ JSON || nil
- #guild_exchange_items(params = {}) ⇒ JSON || nil
- #guild_raids(params = {}) ⇒ JSON || nil
- #guilds(ally_codes, params = {}) ⇒ JSON || nil
- #help_entries(params = {}) ⇒ JSON || nil
-
#initialize ⇒ CLIENT
constructor
A new instance of CLIENT.
- #materials(params = {}) ⇒ JSON || nil
- #player_titles(params = {}) ⇒ JSON || nil
- #players(ally_codes, params = {}) ⇒ JSON || nil
- #power_up_bundles(params = {}) ⇒ JSON || nil
- #raid_configs(params = {}) ⇒ JSON || nil
- #recipes(params = {}) ⇒ JSON || nil
- #requirements(params = {}) ⇒ JSON || nil
- #rosters(ally_codes, params = {}) ⇒ JSON || nil
- #skills(params = {}) ⇒ JSON || nil
- #squads(params = {}) ⇒ JSON || nil
- #starter_guilds(params = {}) ⇒ JSON || nil
- #stat_mod_sets(params = {}) ⇒ JSON || nil
- #stat_mods(params = {}) ⇒ JSON || nil
- #stat_progressions(params = {}) ⇒ JSON || nil
- #tables(params = {}) ⇒ JSON || nil
- #targeting_sets(params = {}) ⇒ JSON || nil
- #territory_battle_definitions(params = {}) ⇒ JSON || nil
- #territory_war_definitions(params = {}) ⇒ JSON || nil
- #units(ally_codes, params = {}) ⇒ JSON || nil
- #units_list(params = {}) ⇒ JSON || nil
- #unlock_announcement_defs(params = {}) ⇒ JSON || nil
- #war_definitions(params = {}) ⇒ JSON || nil
- #xp_tables(params = {}) ⇒ JSON || nil
- #zetas(params = {}) ⇒ JSON || nil
Constructor Details
Instance Attribute Details
#access_token=(value) ⇒ Object
Sets the attribute access_token
8 9 10 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 8 def access_token=(value) @access_token = value end |
#requester=(value) ⇒ Object
Sets the attribute requester
8 9 10 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 8 def requester=(value) @requester = value end |
Instance Method Details
#abilities(params = {}) ⇒ JSON || nil
82 83 84 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 82 def abilities(params = {}) data_collection_request(SWGOH::API::COLLECTION::ABILITY, params) end |
#authorize(username, password) ⇒ String | nil
23 24 25 26 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 23 def (username, password) response = @requester.auth_request(username, password) @access_token = response['access_token'] unless response.nil? end |
#authorized? ⇒ Boolean
16 17 18 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 16 def !@access_token.nil? end |
#battle_environments(params = {}) ⇒ JSON || nil
88 89 90 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 88 def battle_environments(params = {}) data_collection_request(SWGOH::API::COLLECTION::BATTLE_ENVIRONMENT, params) end |
#battle_targeting_rules(params = {}) ⇒ JSON || nil
94 95 96 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 94 def battle_targeting_rules(params = {}) data_collection_request(SWGOH::API::COLLECTION::BATTLE_TARGETING_RULE, params) end |
#battles(params = {}) ⇒ JSON || nil
76 77 78 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 76 def battles(params = {}) request(SWGOH::API::PATH::BATTLES, params) end |
#categories(params = {}) ⇒ JSON || nil
100 101 102 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 100 def categories(params = {}) data_collection_request(SWGOH::API::COLLECTION::CATEGORY, params) end |
#challenge_styles(params = {}) ⇒ JSON || nil
112 113 114 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 112 def challenge_styles(params = {}) data_collection_request(SWGOH::API::COLLECTION::CHALLENGE_STYLE, params) end |
#challenges(params = {}) ⇒ JSON || nil
106 107 108 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 106 def challenges(params = {}) data_collection_request(SWGOH::API::COLLECTION::CHALLENGE, params) end |
#effects(params = {}) ⇒ JSON || nil
118 119 120 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 118 def effects(params = {}) data_collection_request(SWGOH::API::COLLECTION::EFFECT, params) end |
#environment_collections(params = {}) ⇒ JSON || nil
124 125 126 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 124 def environment_collections(params = {}) data_collection_request(SWGOH::API::COLLECTION::ENVIRONMENT_COLLECTION, params) end |
#equipment(params = {}) ⇒ JSON || nil
130 131 132 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 130 def equipment(params = {}) data_collection_request(SWGOH::API::COLLECTION::EQUIPMENT, params) end |
#event_samples(params = {}) ⇒ JSON || nil
136 137 138 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 136 def event_samples(params = {}) data_collection_request(SWGOH::API::COLLECTION::EVENT_SAMPLING, params) end |
#events(params = {}) ⇒ JSON || nil
70 71 72 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 70 def events(params = {}) request(SWGOH::API::PATH::EVENTS, params) end |
#guild_exchange_items(params = {}) ⇒ JSON || nil
142 143 144 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 142 def guild_exchange_items(params = {}) data_collection_request(SWGOH::API::COLLECTION::GUILD_EXCHANGE_ITEM, params) end |
#guild_raids(params = {}) ⇒ JSON || nil
148 149 150 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 148 def guild_raids(params = {}) data_collection_request(SWGOH::API::COLLECTION::GUILD_RAID, params) end |
#guilds(ally_codes, params = {}) ⇒ JSON || nil
38 39 40 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 38 def guilds(ally_codes, params = {}) ally_codes_request(SWGOH::API::PATH::GUILD, ally_codes, params) end |
#help_entries(params = {}) ⇒ JSON || nil
154 155 156 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 154 def help_entries(params = {}) data_collection_request(SWGOH::API::COLLECTION::HELP_ENTRY, params) end |
#materials(params = {}) ⇒ JSON || nil
160 161 162 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 160 def materials(params = {}) data_collection_request(SWGOH::API::COLLECTION::MATERIAL, params) end |
#player_titles(params = {}) ⇒ JSON || nil
166 167 168 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 166 def player_titles(params = {}) data_collection_request(SWGOH::API::COLLECTION::PLAYER_TITLE, params) end |
#players(ally_codes, params = {}) ⇒ JSON || nil
31 32 33 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 31 def players(ally_codes, params = {}) ally_codes_request(SWGOH::API::PATH::PLAYER, ally_codes, params) end |
#power_up_bundles(params = {}) ⇒ JSON || nil
172 173 174 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 172 def power_up_bundles(params = {}) data_collection_request(SWGOH::API::COLLECTION::POWER_UP_BUNDLE, params) end |
#raid_configs(params = {}) ⇒ JSON || nil
178 179 180 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 178 def raid_configs(params = {}) data_collection_request(SWGOH::API::COLLECTION::RAID_CONFIG, params) end |
#recipes(params = {}) ⇒ JSON || nil
184 185 186 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 184 def recipes(params = {}) data_collection_request(SWGOH::API::COLLECTION::RECIPE, params) end |
#requirements(params = {}) ⇒ JSON || nil
190 191 192 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 190 def requirements(params = {}) data_collection_request(SWGOH::API::COLLECTION::REQUIREMENT, params) end |
#rosters(ally_codes, params = {}) ⇒ JSON || nil
45 46 47 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 45 def rosters(ally_codes, params = {}) ally_codes_request(SWGOH::API::PATH::ROSTER, ally_codes, params) end |
#skills(params = {}) ⇒ JSON || nil
196 197 198 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 196 def skills(params = {}) data_collection_request(SWGOH::API::COLLECTION::SKILL, params) end |
#squads(params = {}) ⇒ JSON || nil
64 65 66 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 64 def squads(params = {}) request(SWGOH::API::PATH::SQUADS, params) end |
#starter_guilds(params = {}) ⇒ JSON || nil
202 203 204 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 202 def starter_guilds(params = {}) data_collection_request(SWGOH::API::COLLECTION::STARTER_GUILD, params) end |
#stat_mod_sets(params = {}) ⇒ JSON || nil
214 215 216 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 214 def stat_mod_sets(params = {}) data_collection_request(SWGOH::API::COLLECTION::STAT_MOD_SET, params) end |
#stat_mods(params = {}) ⇒ JSON || nil
208 209 210 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 208 def stat_mods(params = {}) data_collection_request(SWGOH::API::COLLECTION::STAT_MOD, params) end |
#stat_progressions(params = {}) ⇒ JSON || nil
220 221 222 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 220 def stat_progressions(params = {}) data_collection_request(SWGOH::API::COLLECTION::STAT_PROGRESSION, params) end |
#tables(params = {}) ⇒ JSON || nil
226 227 228 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 226 def tables(params = {}) data_collection_request(SWGOH::API::COLLECTION::TABLE, params) end |
#targeting_sets(params = {}) ⇒ JSON || nil
232 233 234 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 232 def targeting_sets(params = {}) data_collection_request(SWGOH::API::COLLECTION::TARGETING_SET, params) end |
#territory_battle_definitions(params = {}) ⇒ JSON || nil
238 239 240 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 238 def territory_battle_definitions(params = {}) data_collection_request(SWGOH::API::COLLECTION::TERRITORY_BATTLE_DEFINITION, params) end |
#territory_war_definitions(params = {}) ⇒ JSON || nil
244 245 246 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 244 def territory_war_definitions(params = {}) data_collection_request(SWGOH::API::COLLECTION::TERRITORY_WAR_DEFINITION, params) end |
#units(ally_codes, params = {}) ⇒ JSON || nil
52 53 54 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 52 def units(ally_codes, params = {}) ally_codes_request(SWGOH::API::PATH::UNITS, ally_codes, params) end |
#units_list(params = {}) ⇒ JSON || nil
250 251 252 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 250 def units_list(params = {}) data_collection_request(SWGOH::API::COLLECTION::UNIT, params) end |
#unlock_announcement_defs(params = {}) ⇒ JSON || nil
256 257 258 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 256 def unlock_announcement_defs(params = {}) data_collection_request(SWGOH::API::COLLECTION::UNLOCK_ANNOUNCEMENT_DEFINITION, params) end |
#war_definitions(params = {}) ⇒ JSON || nil
262 263 264 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 262 def war_definitions(params = {}) data_collection_request(SWGOH::API::COLLECTION::WAR_DEFINITION, params) end |
#xp_tables(params = {}) ⇒ JSON || nil
268 269 270 |
# File 'lib/SWGOH/API/CLIENT/client.rb', line 268 def xp_tables(params = {}) data_collection_request(SWGOH::API::COLLECTION::XP_TABLE, params) end |