threesixtyvoice 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWMzMmUxZGJkYTk4NWRkNThiY2Y4NDMyY2Y5ZTM1N2VmYTY3NzJlOA==
4
+ NGIyODk2ZDEzMWU2NmEyNzgyNjRmNGU0Yjg2YTNmOWJkN2UxZTM1MA==
5
5
  data.tar.gz: !binary |-
6
- ZjEwNjg3MGRjNjRhMzkyN2VlYTVkMjRmOTIyY2NlMmY2NTE4MjllNg==
6
+ OGI1ZDE1NmY4N2QwNjkzYmQ5MzE3YmQ4YTJjNWFiY2Y3MGUyZDQyNg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MmQwMDUzMTcxNTE5ODliM2UzMmY4MTk1YTE1MmE3NDEyMWU1MDk0NmQyNzY3
10
- YjJkNTY0NGU5ZmI5ZGQwOWUyNmE2MDU5ZDU2NGI4NGRhZGM1MzA4OWEzNzli
11
- YzIzMjk1M2MzM2MxNWM4Njc4ZTkxOWM3YTJkYzllMGIwMWI5MjM=
9
+ OWU1Y2U5OTBmODNhY2M5NjAzOGQ5MGIxMDY0OTJjYjgwNDg1OThlYmJjMzE3
10
+ MmRmMTA5ZjBiNWRhYzc1ZWEwMTJiYzMzZDQyYmYyMDI0OTcxMTZhMmEwYzQw
11
+ YTQxMTAyMzg3NmM2YzU3NWUzZWUwM2FkYmFkMDBjOTZhNzJhNjk=
12
12
  data.tar.gz: !binary |-
13
- MzliNjYwNmIwZjIyYTA0ZjNjYTk2NGE5MmIwZWI5M2M5Y2QxNzA5OWQzZjg1
14
- ZWQ2MmU1OTI4YmFlYTgzNTk0YmVlYjA2ZmMzYjExMjYxZmQ1OWY5NTBkZDNl
15
- M2E3OWMyOWJkNTUyYjZlODNjMmY5Njg4NjM3M2EzNDcwNDU2ZGQ=
13
+ N2NhOTM0NDcxODQ0YjU2MzM4YzdjOTQyYjEwMjQwM2VjNTMyZDIzMWJhOTdl
14
+ NDUyNTg3N2U2ZDliOTIyMzY1MzdiMGI5N2RhZGU0MGRiZGY4MjhiZjIwNzJl
15
+ NjZiZTNlMDJjMjRmYzcyODM1ZWNmYTFiOTk5NjExMzhhN2RjNGM=
data/README.md CHANGED
@@ -84,11 +84,21 @@ pop_blogs.popular_blogs.each do |popular|
84
84
  end
85
85
  ```
86
86
 
87
-
88
87
  ### ScoreGetList -TBD
89
88
  ### GroupsProfile -TBD
90
- ### GroupsMembers -TBD
89
+ ### GroupsMembers
90
+ -------------------------
91
+ #### Params
92
+ * id (required): the group id
91
93
 
94
+ ```ruby
95
+ group_members = Threesixtyvoice.group_members(2)
96
+ puts group_members.version
97
+ puts group_members.groupid
98
+ puts group_members.groupname
99
+ puts group_members.grouplink
100
+ group_members.members.each { |m| puts "#{m.gamertag}: #{m.role} - #{m.joindate}"}
101
+ ```
92
102
 
93
103
  ## Contributing
94
104
 
@@ -19,6 +19,11 @@ module Threesixtyvoice
19
19
  Popular.new(doc)
20
20
  end
21
21
 
22
+ def self.group_members(group_id)
23
+ doc = get_xml_doc("/api/group-members.asp?id=#{group_id}")
24
+ GroupMembers.new(doc)
25
+ end
26
+
22
27
  private
23
28
 
24
29
  def self.get_xml_doc(api_path)
@@ -34,3 +39,4 @@ require "threesixtyvoice/badge"
34
39
  require "threesixtyvoice/badge_list"
35
40
  require "threesixtyvoice/badges_list_gamertags"
36
41
  require "threesixtyvoice/popular"
42
+ require "threesixtyvoice/group_members"
@@ -0,0 +1,19 @@
1
+ module Threesixtyvoice
2
+ class GroupMembers
3
+ attr_reader :version, :groupid, :groupname, :grouplink, :members
4
+
5
+ def initialize(doc)
6
+ @version = doc.xpath('//api/groupinfo/version').text
7
+ @groupid = doc.xpath('//api/groupinfo/groupid').text
8
+ @groupname = doc.xpath('//api/groupinfo/groupname').text
9
+ @grouplink = doc.xpath('//api/groupinfo/grouplink').text
10
+ @members = doc.xpath('//api/groupmembers/member').map do |i|
11
+ GroupMember.new(i.xpath('gamertag').text, i.xpath('joindate').text, i.xpath('role').text)
12
+ end
13
+ end
14
+ end
15
+
16
+ class GroupMember < Struct.new("GroupMember", :gamertag, :joindate, :role)
17
+ end
18
+ end
19
+
@@ -1,3 +1,3 @@
1
1
  module Threesixtyvoice
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: threesixtyvoice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Larrabee
@@ -54,6 +54,7 @@ files:
54
54
  - lib/threesixtyvoice/badge.rb
55
55
  - lib/threesixtyvoice/badge_list.rb
56
56
  - lib/threesixtyvoice/badges_list_gamertags.rb
57
+ - lib/threesixtyvoice/group_members.rb
57
58
  - lib/threesixtyvoice/popular.rb
58
59
  - lib/threesixtyvoice/version.rb
59
60
  - test/threesixtyvoice_test.rb