Class: Wowr::Classes::FullGuild

Inherits:
Guild
  • Object
show all
Defined in:
lib/wowr/guild.rb

Overview

<guildInfo>

<guild>
  <members filterField="" filterValue="" maxPage="1" memberCount="1" page="1" sortDir="a" sortField="">
    <character class="Paladin" classId="2" gender="Male" genderId="0" level="14" name="Sturky" race="Dwarf" raceId="3" rank="0" url="r=Stormrage&amp;n=Sturky"/>
  </members>
</guild>

</guildInfo>

Instance Attribute Summary collapse

Attributes inherited from Guild

#name, #realm, #url

Instance Method Summary collapse

Constructor Details

#initialize(elem) ⇒ FullGuild

Returns a new instance of FullGuild.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/wowr/guild.rb', line 66

def initialize(elem)
	super(elem)
	
	@name_url			= elem[:nameUrl]
	@realm_url		= elem[:realmUrl]
	
	# Guild/guild_id/guild_url not set for characters
	if (elem%'guildInfo')
		# @member_count = (elem%'guildInfo'%'guild'%'members')[:memberCount].to_i || nil
		@members = {}
		(elem%'guildInfo'%'guild'%'members'/:character).each do |char|
			# TODO: Change to search character?
			members[char[:name]] = Character.new(char)
		end
	end
end

Instance Attribute Details

#membersObject (readonly)

, :member_count



64
65
66
# File 'lib/wowr/guild.rb', line 64

def members
  @members
end

#name_urlObject (readonly)

, :member_count



64
65
66
# File 'lib/wowr/guild.rb', line 64

def name_url
  @name_url
end

#realm_urlObject (readonly)

, :member_count



64
65
66
# File 'lib/wowr/guild.rb', line 64

def realm_url
  @realm_url
end