Class: Wowr::Classes::RepFactionCategory

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

Overview

Larger group of factions Used for faction information eg Alliance, Shattrath City, Steamwheedle Cartel

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elem) ⇒ RepFactionCategory

Returns a new instance of RepFactionCategory.



781
782
783
784
785
786
787
788
789
# File 'lib/wowr/character.rb', line 781

def initialize(elem)
	@key 	= elem[:key]
	@name = elem[:name]
	
	@factions = {}
	(elem/:faction).each do |faction|
		@factions[faction[:key]] = RepFaction.new(faction)
	end
end

Instance Attribute Details

#factionsObject (readonly)

Returns the value of attribute factions.



778
779
780
# File 'lib/wowr/character.rb', line 778

def factions
  @factions
end

#keyObject (readonly)

Returns the value of attribute key.



778
779
780
# File 'lib/wowr/character.rb', line 778

def key
  @key
end

#nameObject (readonly) Also known as: to_s

Returns the value of attribute name.



778
779
780
# File 'lib/wowr/character.rb', line 778

def name
  @name
end

Instance Method Details

#totalObject



791
792
793
794
795
# File 'lib/wowr/character.rb', line 791

def total
	total = 0
	factions.each_value { |faction| total += faction.reputation }
	return total
end