Class: Wowr::Classes::GuildBankLogEntry
- Inherits:
-
Object
- Object
- Wowr::Classes::GuildBankLogEntry
- Defined in:
- lib/wowr/guild_bank.rb
Overview
Zero to 1 items <banklog dtab=“” money=“1200000” otab=“” player=“Quixsilver” rank=“0” ts=“1212595269000” type=“4”/> <banklog dtab=“” money=“0” otab=“0” player=“Quixsilver” rank=“0” ts=“1212527470000” type=“2”> <item count=“1” icon=“inv_potion_92” id=“12820” name=“Winterfall Firewater” qi=“1” subtype=“” type=“consumables”/> </banklog>
Constant Summary collapse
- @@types =
{ 1 => 'Deposit Item', 2 => 'Withdraw Item', 3 => 'Move Item', 4 => 'Deposit Money', 5 => 'Withdraw Money', 6 => 'Repair' }
Instance Attribute Summary collapse
-
#dtab ⇒ Object
readonly
Returns the value of attribute dtab.
-
#item ⇒ Object
readonly
Returns the value of attribute item.
-
#money ⇒ Object
readonly
Returns the value of attribute money.
-
#otab ⇒ Object
readonly
Returns the value of attribute otab.
-
#player ⇒ Object
readonly
Returns the value of attribute player.
-
#rank_id ⇒ Object
readonly
Returns the value of attribute rank_id.
-
#ts ⇒ Object
readonly
Returns the value of attribute ts.
-
#type_id ⇒ Object
readonly
Returns the value of attribute type_id.
Instance Method Summary collapse
- #destination ⇒ Object
-
#initialize(elem, bank = nil, api = nil) ⇒ GuildBankLogEntry
constructor
A new instance of GuildBankLogEntry.
- #origin ⇒ Object
- #rank ⇒ Object
- #time ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(elem, bank = nil, api = nil) ⇒ GuildBankLogEntry
Returns a new instance of GuildBankLogEntry.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/wowr/guild_bank.rb', line 101 def initialize(elem, bank = nil, api = nil) @bank = bank @dtab = elem[:dtab] == "" ? nil : elem[:dtab].to_i @otab = elem[:otab] == "" ? nil : elem[:otab].to_i @money = Money.new(elem[:money].to_i) @player = elem[:player] @rank_id = elem[:rank].to_i @ts = elem[:ts].to_i # TODO: Check TS isn't overloading @type_id = elem[:type].to_i if (elem%'item') @item = GuildBankLogItem.new(elem%'item', api) end end |
Instance Attribute Details
#dtab ⇒ Object (readonly)
Returns the value of attribute dtab.
90 91 92 |
# File 'lib/wowr/guild_bank.rb', line 90 def dtab @dtab end |
#item ⇒ Object (readonly)
Returns the value of attribute item.
90 91 92 |
# File 'lib/wowr/guild_bank.rb', line 90 def item @item end |
#money ⇒ Object (readonly)
Returns the value of attribute money.
90 91 92 |
# File 'lib/wowr/guild_bank.rb', line 90 def money @money end |
#otab ⇒ Object (readonly)
Returns the value of attribute otab.
90 91 92 |
# File 'lib/wowr/guild_bank.rb', line 90 def otab @otab end |
#player ⇒ Object (readonly)
Returns the value of attribute player.
90 91 92 |
# File 'lib/wowr/guild_bank.rb', line 90 def player @player end |
#rank_id ⇒ Object (readonly)
Returns the value of attribute rank_id.
90 91 92 |
# File 'lib/wowr/guild_bank.rb', line 90 def rank_id @rank_id end |
#ts ⇒ Object (readonly)
Returns the value of attribute ts.
90 91 92 |
# File 'lib/wowr/guild_bank.rb', line 90 def ts @ts end |
#type_id ⇒ Object (readonly)
Returns the value of attribute type_id.
90 91 92 |
# File 'lib/wowr/guild_bank.rb', line 90 def type_id @type_id end |
Instance Method Details
#destination ⇒ Object
129 130 131 |
# File 'lib/wowr/guild_bank.rb', line 129 def destination @dtab.nil? ? nil : @bank.bags[@dtab] end |
#origin ⇒ Object
125 126 127 |
# File 'lib/wowr/guild_bank.rb', line 125 def origin @otab.nil? ? nil : @bank.bags[@otab] end |
#rank ⇒ Object
121 122 123 |
# File 'lib/wowr/guild_bank.rb', line 121 def rank @rank_id.nil? ? nil : @bank.ranks[@rank_id] end |
#time ⇒ Object
133 134 135 |
# File 'lib/wowr/guild_bank.rb', line 133 def time return Time.at(@ts / 1000) end |
#type ⇒ Object
117 118 119 |
# File 'lib/wowr/guild_bank.rb', line 117 def type return @@types[@type_id] end |