Module: Lich::Common::Account
- Defined in:
- documented/common/account.rb
Class Method Summary collapse
-
.character ⇒ Object
Retrieves the character associated with the account.
-
.character=(value) ⇒ Object
Sets the character for the account.
-
.characters ⇒ Array
Retrieves the character names associated with the account.
-
.game_code ⇒ String
Retrieves the game code associated with the account.
-
.game_code=(value) ⇒ String
Sets the game code for the account.
-
.members ⇒ Hash
Retrieves the members associated with the account.
-
.members=(value) ⇒ Hash
Sets the members for the account.
-
.name ⇒ String
Retrieves the name of the account.
-
.name=(value) ⇒ String
Sets the name of the account.
-
.subscription ⇒ String
Retrieves the subscription type of the account.
-
.subscription=(value) ⇒ String
Sets the subscription type for the account.
-
.type ⇒ String?
Retrieves the type of account based on game data.
Class Method Details
.character ⇒ Object
Retrieves the character associated with the account
34 35 36 |
# File 'documented/common/account.rb', line 34 def self.character @@character end |
.character=(value) ⇒ Object
Sets the character for the account
43 44 45 |
# File 'documented/common/account.rb', line 43 def self.character=(value) @@character = value end |
.characters ⇒ Array
Retrieves the character names associated with the account
119 120 121 |
# File 'documented/common/account.rb', line 119 def self.characters @@members.values end |
.game_code ⇒ String
Retrieves the game code associated with the account
80 81 82 |
# File 'documented/common/account.rb', line 80 def self.game_code @@game_code end |
.game_code=(value) ⇒ String
Sets the game code for the account
89 90 91 |
# File 'documented/common/account.rb', line 89 def self.game_code=(value) @@game_code = value end |
.members ⇒ Hash
Retrieves the members associated with the account
97 98 99 |
# File 'documented/common/account.rb', line 97 def self.members @@members end |
.members=(value) ⇒ Hash
Sets the members for the account
106 107 108 109 110 111 112 113 |
# File 'documented/common/account.rb', line 106 def self.members=(value) potential_members = {} for code_name in value.sub(/^C\t[0-9]+\t[0-9]+\t[0-9]+\t[0-9]+[\t\n]/, '').scan(/[^\t]+\t[^\t^\n]+/) char_code, char_name = code_name.split("\t") potential_members[char_code] = char_name end @@members = potential_members end |
.name ⇒ String
Retrieves the name of the account
17 18 19 |
# File 'documented/common/account.rb', line 17 def self.name @@name end |
.name=(value) ⇒ String
Sets the name of the account
26 27 28 |
# File 'documented/common/account.rb', line 26 def self.name=(value) @@name = value end |
.subscription ⇒ String
Retrieves the subscription type of the account
51 52 53 |
# File 'documented/common/account.rb', line 51 def self.subscription @@subscription end |
.subscription=(value) ⇒ String
Sets the subscription type for the account
70 71 72 73 74 |
# File 'documented/common/account.rb', line 70 def self.subscription=(value) if value =~ /(NORMAL|PREMIUM|TRIAL|INTERNAL|FREE)/ @@subscription = Regexp.last_match(1) end end |