Module: Lich::Common::Account
- Defined in:
- documented/common/account.rb
Class Method Summary collapse
-
.character ⇒ String?
Returns the character associated with the account.
-
.character=(value) ⇒ void
Sets the character for the account.
-
.characters ⇒ Array<String>
Returns the character names of the members associated with the account.
-
.game_code ⇒ String?
Returns the game code associated with the account.
-
.game_code=(value) ⇒ void
Sets the game code for the account.
-
.members ⇒ Hash
Returns the members associated with the account.
-
.members=(value) ⇒ void
Sets the members for the account based on a formatted string.
-
.name ⇒ String?
Returns the name associated with the account.
-
.name=(value) ⇒ void
Sets the name for the account.
-
.subscription ⇒ String?
Returns the subscription type of the account.
-
.subscription=(value) ⇒ void
Sets the subscription type for the account.
-
.type ⇒ String?
Returns the type of account based on the game code.
Class Method Details
.character ⇒ String?
Returns the character associated with the account.
27 28 29 |
# File 'documented/common/account.rb', line 27 def self.character @@character end |
.character=(value) ⇒ void
This method returns an undefined value.
Sets the character for the account.
34 35 36 |
# File 'documented/common/account.rb', line 34 def self.character=(value) @@character = value end |
.characters ⇒ Array<String>
Returns the character names of the members associated with the account.
99 100 101 |
# File 'documented/common/account.rb', line 99 def self.characters @@members.values end |
.game_code ⇒ String?
Returns the game code associated with the account.
66 67 68 |
# File 'documented/common/account.rb', line 66 def self.game_code @@game_code end |
.game_code=(value) ⇒ void
This method returns an undefined value.
Sets the game code for the account.
73 74 75 |
# File 'documented/common/account.rb', line 73 def self.game_code=(value) @@game_code = value end |
.members ⇒ Hash
Returns the members associated with the account.
80 81 82 |
# File 'documented/common/account.rb', line 80 def self.members @@members end |
.members=(value) ⇒ void
This method returns an undefined value.
Sets the members for the account based on a formatted string.
87 88 89 90 91 92 93 94 |
# File 'documented/common/account.rb', line 87 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?
Returns the name associated with the account.
13 14 15 |
# File 'documented/common/account.rb', line 13 def self.name @@name end |
.name=(value) ⇒ void
This method returns an undefined value.
Sets the name for the account.
20 21 22 |
# File 'documented/common/account.rb', line 20 def self.name=(value) @@name = value end |
.subscription ⇒ String?
Returns the subscription type of the account.
41 42 43 |
# File 'documented/common/account.rb', line 41 def self.subscription @@subscription end |
.subscription=(value) ⇒ void
This method returns an undefined value.
Sets the subscription type for the account.
57 58 59 60 61 |
# File 'documented/common/account.rb', line 57 def self.subscription=(value) if value =~ /(NORMAL|PREMIUM|TRIAL|INTERNAL|FREE)/ @@subscription = Regexp.last_match(1) end end |