Class: Wowr::Classes::GuildBankItem

Inherits:
Item
  • Object
show all
Defined in:
lib/wowr/guild_bank.rb

Overview

More detailed item used in full Wowr::Classes::GuildBank Very close to Wowr::Classes::EquippedItem <item bag=“0” durability=“0” icon=“racial_dwarf_findtreasure” id=“12219” maxDurability=“0” name=“Unadorned Seal of Ascension” qi=“1” quantity=“1” randomPropertiesId=“0” seed=“1827537860” slot=“90” subtype=“” subtypeLoc=“Quest” type=“consumables”/>

Instance Attribute Summary collapse

Attributes inherited from Item

#icon_base, #id, #name

Instance Method Summary collapse

Methods inherited from Item

#icon

Constructor Details

#initialize(elem, bags = nil, api = nil) ⇒ GuildBankItem

Returns a new instance of GuildBankItem.



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/wowr/guild_bank.rb', line 161

def initialize(elem, bags = nil, api = nil)
	super(elem, api)
	
	@bag_id		= elem[:bag].to_i
	@qi				= elem[:qi].to_i
	@quantity = elem[:quantity].to_i
	
	@durability						= elem[:durability].to_i
	@max_durability				= elem[:maxDurability].to_i
	@random_properties_id = elem[:randomPropertiesId] == 0 ? nil : elem[:randomPropertiesId].to_i
	@seed					= elem[:seed].to_i
	@slot					= elem[:slot].to_i
	@subtype			= elem[:subtype]		== "" ? nil : elem[:subtype]
	@subtype_loc	= elem[:subtypeLoc] == "" ? nil : elem[:subtypeLoc]
	@type					= elem[:type].to_i
	
	bags[@bag_id].items << self
end

Instance Attribute Details

#bag_idObject (readonly)

Returns the value of attribute bag_id.



158
159
160
# File 'lib/wowr/guild_bank.rb', line 158

def bag_id
  @bag_id
end

#durabilityObject (readonly)

Returns the value of attribute durability.



158
159
160
# File 'lib/wowr/guild_bank.rb', line 158

def durability
  @durability
end

#max_durabilityObject (readonly)

Returns the value of attribute max_durability.



158
159
160
# File 'lib/wowr/guild_bank.rb', line 158

def max_durability
  @max_durability
end

#qiObject (readonly)

Returns the value of attribute qi.



158
159
160
# File 'lib/wowr/guild_bank.rb', line 158

def qi
  @qi
end

#quantityObject (readonly)

Returns the value of attribute quantity.



158
159
160
# File 'lib/wowr/guild_bank.rb', line 158

def quantity
  @quantity
end

#random_properties_idObject (readonly)

Returns the value of attribute random_properties_id.



158
159
160
# File 'lib/wowr/guild_bank.rb', line 158

def random_properties_id
  @random_properties_id
end

#seedObject (readonly)

Returns the value of attribute seed.



158
159
160
# File 'lib/wowr/guild_bank.rb', line 158

def seed
  @seed
end

#slotObject (readonly)

Returns the value of attribute slot.



158
159
160
# File 'lib/wowr/guild_bank.rb', line 158

def slot
  @slot
end

#subtypeObject (readonly)

Returns the value of attribute subtype.



158
159
160
# File 'lib/wowr/guild_bank.rb', line 158

def subtype
  @subtype
end

#subtype_locObject (readonly)

Returns the value of attribute subtype_loc.



158
159
160
# File 'lib/wowr/guild_bank.rb', line 158

def subtype_loc
  @subtype_loc
end

#typeObject (readonly)

Returns the value of attribute type.



158
159
160
# File 'lib/wowr/guild_bank.rb', line 158

def type
  @type
end