Class: Threesixtyvoice::GroupMembers

Inherits:
Object
  • Object
show all
Defined in:
lib/threesixtyvoice/group_members.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(doc) ⇒ GroupMembers

Returns a new instance of GroupMembers.



5
6
7
8
9
10
11
12
13
# File 'lib/threesixtyvoice/group_members.rb', line 5

def initialize(doc)
  @version = doc.xpath('//api/groupinfo/version').text
  @groupid = doc.xpath('//api/groupinfo/groupid').text
  @groupname = doc.xpath('//api/groupinfo/groupname').text
  @grouplink = doc.xpath('//api/groupinfo/grouplink').text
  @members = doc.xpath('//api/groupmembers/member').map do |i|
    GroupMember.new(i.xpath('gamertag').text, i.xpath('joindate').text, i.xpath('role').text)
  end
end

Instance Attribute Details

#groupidObject (readonly)

Returns the value of attribute groupid.



3
4
5
# File 'lib/threesixtyvoice/group_members.rb', line 3

def groupid
  @groupid
end

Returns the value of attribute grouplink.



3
4
5
# File 'lib/threesixtyvoice/group_members.rb', line 3

def grouplink
  @grouplink
end

#groupnameObject (readonly)

Returns the value of attribute groupname.



3
4
5
# File 'lib/threesixtyvoice/group_members.rb', line 3

def groupname
  @groupname
end

#membersObject (readonly)

Returns the value of attribute members.



3
4
5
# File 'lib/threesixtyvoice/group_members.rb', line 3

def members
  @members
end

#versionObject (readonly)

Returns the value of attribute version.



3
4
5
# File 'lib/threesixtyvoice/group_members.rb', line 3

def version
  @version
end