-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wargaming.NET -> Accounts functions implementation #8
- Loading branch information
Showing
7 changed files
with
89 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require 'wargaming_api/request' | ||
|
||
module WargamingApi | ||
class WargamingApi::WargamingNet < WargamingApi::Request | ||
|
||
puts 'WargamingNet loaded.' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require 'wargaming_api/wargaming_net' | ||
|
||
module WargamingApi | ||
class WargamingApi::WargamingNet::Accounts < WargamingApi::WargamingNet | ||
|
||
puts 'WargamingNet => Accounts loaded.' | ||
end | ||
end |
21 changes: 21 additions & 0 deletions
21
lib/wargaming_api/wargaming_net/accounts/account_information.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require 'wargaming_api/wargaming_net/accounts' | ||
|
||
|
||
module WargamingApi | ||
class WargamingApi::WargamingNet::Accounts | ||
class WargamingApi::WargamingNet::Accounts::AccountInformation < WargamingApi::WargamingNet::Accounts | ||
|
||
attr_accessor :access_token, :account_id | ||
|
||
def initialize | ||
@link = 'api.worldoftanks.eu/wgn/account/info' | ||
@application_id = WargamingApi::APP_TOKEN | ||
@language = 'en' | ||
@access_token = '0710bb4eb4568a157047dc86bb5f394e2b357617' | ||
@account_id = 509851940 | ||
end | ||
|
||
puts 'WargamingNet => Accounts -> AccountInformation loaded.' | ||
end | ||
end | ||
end |
48 changes: 48 additions & 0 deletions
48
lib/wargaming_api/wargaming_net/accounts/list_of_accounts.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
require 'wargaming_api/wargaming_net/accounts' | ||
|
||
|
||
module WargamingApi | ||
class WargamingApi::WargamingNet::Accounts | ||
class WargamingApi::WargamingNet::Accounts::ListOfAccounts < WargamingApi::WargamingNet::Accounts | ||
|
||
attr_reader :game, :type | ||
attr_accessor :search, :limit | ||
|
||
def initialize | ||
@link = 'api.worldoftanks.eu/wgn/account/list' | ||
@application_id = WargamingApi::APP_TOKEN | ||
@language = 'en' | ||
@game = 'wot' | ||
@type = 'exact' | ||
@limit = 100 | ||
@search = 'banzsolt' | ||
end | ||
|
||
def self.possible_game | ||
return %w(wotb wot wows wotg wowp) | ||
end | ||
|
||
def self.possible_type | ||
return %w(startswith exact) | ||
end | ||
|
||
def set_game(value) | ||
if WargamingApi::WargamingNet::Accounts::ListOfAccounts.possible_game.include? value | ||
@game = value | ||
else | ||
@game = 'wot' | ||
end | ||
end | ||
|
||
def set_type(value) | ||
if WargamingApi::WargamingNet::Accounts::ListOfAccounts.possible_type.include? value | ||
@game = value | ||
else | ||
@game = 'exact' | ||
end | ||
end | ||
|
||
puts 'WargamingNet => Accounts -> ListOfAccounts loaded.' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters