Class: Wowr::Classes::Guild
- Inherits:
-
Object
- Object
- Wowr::Classes::Guild
- 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
-
#battle_group ⇒ Object
readonly
Returns the value of attribute battle_group.
-
#faction ⇒ Object
readonly
Returns the value of attribute faction.
-
#faction_id ⇒ Object
readonly
Returns the value of attribute faction_id.
-
#member_count ⇒ Object
readonly
Returns the value of attribute member_count.
-
#members ⇒ Object
readonly
Returns the value of attribute members.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#realm ⇒ Object
readonly
Returns the value of attribute realm.
-
#realm_url ⇒ Object
readonly
Returns the value of attribute realm_url.
-
#roster_url ⇒ Object
readonly
Returns the value of attribute roster_url.
-
#stats_url ⇒ Object
readonly
Returns the value of attribute stats_url.
-
#stats_url_escape ⇒ Object
readonly
Returns the value of attribute stats_url_escape.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(elem) ⇒ Guild
constructor
A new instance of Guild.
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_group ⇒ Object (readonly)
Returns the value of attribute battle_group.
669 670 671 |
# File 'lib/wowr/classes.rb', line 669 def battle_group @battle_group end |
#faction ⇒ Object (readonly)
Returns the value of attribute faction.
669 670 671 |
# File 'lib/wowr/classes.rb', line 669 def faction @faction end |
#faction_id ⇒ Object (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_count ⇒ Object (readonly)
Returns the value of attribute member_count.
669 670 671 |
# File 'lib/wowr/classes.rb', line 669 def member_count @member_count end |
#members ⇒ Object (readonly)
Returns the value of attribute members.
669 670 671 |
# File 'lib/wowr/classes.rb', line 669 def members @members end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
669 670 671 |
# File 'lib/wowr/classes.rb', line 669 def name @name end |
#realm ⇒ Object (readonly)
Returns the value of attribute realm.
669 670 671 |
# File 'lib/wowr/classes.rb', line 669 def realm @realm end |
#realm_url ⇒ Object (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_url ⇒ Object (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_url ⇒ Object (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_escape ⇒ Object (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 |
#url ⇒ Object (readonly)
Returns the value of attribute url.
669 670 671 |
# File 'lib/wowr/classes.rb', line 669 def url @url end |