Class: Wowr::Classes::Guild

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

Overview

A player guild containing members note not all of these will be filled out, depending on how the data is found

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elem) ⇒ Guild

Returns a new instance of Guild.



674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
# File 'lib/wowr/classes.rb', line 674

def initialize(elem)
	if (elem%'guildKey')
		guild = (elem%'guildKey')
	else
		guild = elem
	end
	
	@name					= guild[:name]
	@name_url			= guild[:nameUrl]
	@url					= guild[:url]
	@realm				= guild[:realm]
	@realm_url		= guild[:realmUrl]
	@battle_group = guild[:battleGroup]
	@faction			= guild[:faction]
	@faction_id		= guild[:factionId].to_i
	
	# some shortened versions
	if (elem%'guildInfo')
		@member_count = (elem%'guildInfo'%'guild'%'members')[:memberCount].to_i || nil
	
		@members = []
		(elem%'guildInfo'%'guild'%'members'/:character).each do |char|
			members << Character.new(char)
		end
	end
end

Instance Attribute Details

#battle_groupObject (readonly)

Returns the value of attribute battle_group.



669
670
671
# File 'lib/wowr/classes.rb', line 669

def battle_group
  @battle_group
end

#factionObject (readonly)

Returns the value of attribute faction.



669
670
671
# File 'lib/wowr/classes.rb', line 669

def faction
  @faction
end

#faction_idObject (readonly)

Returns the value of attribute faction_id.



669
670
671
# File 'lib/wowr/classes.rb', line 669

def faction_id
  @faction_id
end

#member_countObject (readonly)

Returns the value of attribute member_count.



669
670
671
# File 'lib/wowr/classes.rb', line 669

def member_count
  @member_count
end

#membersObject (readonly)

Returns the value of attribute members.



669
670
671
# File 'lib/wowr/classes.rb', line 669

def members
  @members
end

#nameObject (readonly)

Returns the value of attribute name.



669
670
671
# File 'lib/wowr/classes.rb', line 669

def name
  @name
end

#realmObject (readonly)

Returns the value of attribute realm.



669
670
671
# File 'lib/wowr/classes.rb', line 669

def realm
  @realm
end

#realm_urlObject (readonly)

Returns the value of attribute realm_url.



669
670
671
# File 'lib/wowr/classes.rb', line 669

def realm_url
  @realm_url
end

#roster_urlObject (readonly)

Returns the value of attribute roster_url.



669
670
671
# File 'lib/wowr/classes.rb', line 669

def roster_url
  @roster_url
end

#stats_urlObject (readonly)

Returns the value of attribute stats_url.



669
670
671
# File 'lib/wowr/classes.rb', line 669

def stats_url
  @stats_url
end

#stats_url_escapeObject (readonly)

Returns the value of attribute stats_url_escape.



669
670
671
# File 'lib/wowr/classes.rb', line 669

def stats_url_escape
  @stats_url_escape
end

#urlObject (readonly)

Returns the value of attribute url.



669
670
671
# File 'lib/wowr/classes.rb', line 669

def url
  @url
end