rublox 0.1.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +21 -21
- data/{README.MD → README.md} +58 -68
- data/lib/rublox/bases/base_group.rb +19 -0
- data/lib/rublox/bases/base_user.rb +19 -0
- data/lib/rublox/derive/group.rb +33 -50
- data/lib/rublox/derive/model.rb +17 -0
- data/lib/rublox/derive/user.rb +43 -89
- data/lib/rublox/models/full_group.rb +55 -60
- data/lib/rublox/models/full_user.rb +40 -49
- data/lib/rublox/models/group_shout.rb +26 -62
- data/lib/rublox/models/presence.rb +59 -98
- data/lib/rublox/models/skinny_user.rb +28 -0
- data/lib/rublox/util/api_helper.rb +69 -0
- data/lib/rublox/util/errors.rb +44 -109
- data/lib/rublox.rb +89 -136
- data/rublox.gemspec +30 -32
- metadata +31 -49
- data/CHANGELOG.MD +0 -4
- data/Gemfile +0 -6
- data/Rakefile +0 -33
- data/lib/rublox/models/group_member.rb +0 -54
- data/lib/rublox/models/group_role.rb +0 -70
- data/lib/rublox/models/limited_user.rb +0 -34
- data/lib/rublox/util/cache.rb +0 -39
- data/lib/rublox/util/http_client.rb +0 -95
- data/lib/rublox/util/pages.rb +0 -85
- data/lib/rublox/util/url.rb +0 -25
- data/lib/rublox/version.rb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca58ae27999a8a9d6dad08937ce3167d34163e903571912c47da20cd19c1814a
|
4
|
+
data.tar.gz: 6116e15392c612305c88425a84d737a867bf6531d36022354f4d410147987837
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 353887d40de73fdb4926837cdfc5209e310db9a9bd323283f288ed312e709e71425133f556f734badd7a54429fbff8fd8acc066fe00dc5701a72ca5c0491bc18
|
7
|
+
data.tar.gz: 03bbc4ff1011eda5b039c7dcdd9dafcbec8c3f20ae6c462e6e817dcd3b5e2abe849fd2a318ed6d92e7ff542e882aa4b5647e5070430e80b34ade740631b77631
|
data/LICENSE
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2021 Roblox API wrappers
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2021 Roblox API wrappers
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/{README.MD → README.md}
RENAMED
@@ -1,68 +1,58 @@
|
|
1
|
-
<div align="center">
|
2
|
-
<img src="https://raw.githubusercontent.com/roblox-api-wrappers/.github/main/res/rublox_logo.png" alt="rublox" width="15%" height="15%"/>
|
3
|
-
</div>
|
4
|
-
|
5
|
-
<br>
|
6
|
-
|
7
|
-
<div align="center">
|
8
|
-
<a href="https://rubygems.org/gems/rublox">
|
9
|
-
<img alt="gem" src="https://img.shields.io/gem/dt/rublox?color=rgb%28170%2C%200%2C%200%29&logo=rubygems&style=flat-square">
|
10
|
-
</a>
|
11
|
-
|
12
|
-
<a href="https://rubygems.org/gems/rublox">
|
13
|
-
<img alt="gem version" src="https://img.shields.io/gem/v/rublox?color=rgb%28170%2C%200%2C%200%29&label=gem%20version&logo=rubygems&style=flat-square">
|
14
|
-
</a>
|
15
|
-
|
16
|
-
<a href="https://github.com/roblox-api-wrappers/rublox/blob/main/LICENSE">
|
17
|
-
<img alt="license: MIT" src="https://img.shields.io/github/license/roblox-api-wrappers/rublox?color=rgb%28150%2C%200%2C%200%29&logo=github&style=flat-square">
|
18
|
-
</a>
|
19
|
-
|
20
|
-
<img alt="commit activity" src="https://img.shields.io/github/commit-activity/m/roblox-api-wrappers/rublox?color=rgb%28170%2C%200%2C%200%29&logo=github&style=flat-square">
|
21
|
-
|
22
|
-
<img alt="repo stars" src="https://img.shields.io/github/stars/roblox-api-wrappers/rublox?color=rgb%28170%2C%200%2C%200%29&logo=github&style=flat-square">
|
23
|
-
|
24
|
-
<a href="https://rubydoc.info/gems/rublox">
|
25
|
-
<img alt="docs" src="https://img.shields.io/badge/docs-rubydoc.info-aa0000?style=flat-square">
|
26
|
-
</a>
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
#
|
57
|
-
|
58
|
-
|
59
|
-
client = Rublox::Client.new("_|WARNING:-DO-NOT-SHARE-THIS.--Sharing-this ...")
|
60
|
-
```
|
61
|
-
|
62
|
-
**(if you open-source/work with other people on your application, it is recommended to keep your cookie in a `.env` file and load it with a library like [dotenv](https://rubygems.org/gems/dotenv))**
|
63
|
-
|
64
|
-
From there, you can build off your application's logic with methods provided via [Rublox::Client](https://rubydoc.info/gems/rublox/Rublox/Client)
|
65
|
-
|
66
|
-
# Documentation
|
67
|
-
|
68
|
-
You can access the documentation at https://rubydoc.info/gems/rublox.
|
1
|
+
<div align="center">
|
2
|
+
<img src="https://raw.githubusercontent.com/roblox-api-wrappers/.github/main/res/rublox_logo.png" alt="rublox" width="15%" height="15%"/>
|
3
|
+
</div>
|
4
|
+
|
5
|
+
<br>
|
6
|
+
|
7
|
+
<div align="center">
|
8
|
+
<a href="https://rubygems.org/gems/rublox">
|
9
|
+
<img alt="gem" src="https://img.shields.io/gem/dt/rublox?color=rgb%28170%2C%200%2C%200%29&logo=rubygems&style=flat-square">
|
10
|
+
</a>
|
11
|
+
|
12
|
+
<a href="https://rubygems.org/gems/rublox">
|
13
|
+
<img alt="gem version" src="https://img.shields.io/gem/v/rublox?color=rgb%28170%2C%200%2C%200%29&label=gem%20version&logo=rubygems&style=flat-square">
|
14
|
+
</a>
|
15
|
+
|
16
|
+
<a href="https://github.com/roblox-api-wrappers/rublox/blob/main/LICENSE">
|
17
|
+
<img alt="license: MIT" src="https://img.shields.io/github/license/roblox-api-wrappers/rublox?color=rgb%28150%2C%200%2C%200%29&logo=github&style=flat-square">
|
18
|
+
</a>
|
19
|
+
|
20
|
+
<img alt="commit activity" src="https://img.shields.io/github/commit-activity/m/roblox-api-wrappers/rublox?color=rgb%28170%2C%200%2C%200%29&logo=github&style=flat-square">
|
21
|
+
|
22
|
+
<img alt="repo stars" src="https://img.shields.io/github/stars/roblox-api-wrappers/rublox?color=rgb%28170%2C%200%2C%200%29&logo=github&style=flat-square">
|
23
|
+
|
24
|
+
<a href="https://rubydoc.info/gems/rublox">
|
25
|
+
<img alt="docs" src="https://img.shields.io/badge/docs-rubydoc.info-aa0000?style=flat-square">
|
26
|
+
</a>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div align="center"> <i>rublox is a Roblox web API wrapper written in Ruby. It aims to provide an object oriented interface to get and modify data from Roblox's web API. </i> </div>
|
30
|
+
|
31
|
+
<br>
|
32
|
+
|
33
|
+
# Getting Started
|
34
|
+
|
35
|
+
Authentication can be done by setting the .ROBLOSECURITY cookie through `Rublox.roblosecurity=`
|
36
|
+
```ruby
|
37
|
+
require "rublox"
|
38
|
+
|
39
|
+
Rublox.roblosecurity = "cookie"
|
40
|
+
|
41
|
+
require "dotenv"
|
42
|
+
Dotenv.load
|
43
|
+
|
44
|
+
Rublox.roblosecurity = ENV["ROBLOSECURITY"]
|
45
|
+
```
|
46
|
+
|
47
|
+
All classes representing the Roblox API models should not be initialised by the user. Instead, they are all made through methods in modules and classes.
|
48
|
+
Models can be found by searching through classes:
|
49
|
+
|
50
|
+
![](https://cdn.discordapp.com/attachments/827652175609856053/1070881521348653056/image.png)
|
51
|
+
|
52
|
+
And methods for getting the corresponding model can be found by searching through methods:
|
53
|
+
|
54
|
+
![](https://cdn.discordapp.com/attachments/827652175609856053/1070881991093919794/image.png)
|
55
|
+
|
56
|
+
# Documentation
|
57
|
+
|
58
|
+
You can access the documentation at https://rubydoc.info/gems/rublox.
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rublox/derive/group"
|
4
|
+
|
5
|
+
module Rublox
|
6
|
+
module Bases
|
7
|
+
class BaseGroup
|
8
|
+
include Derive::Group
|
9
|
+
|
10
|
+
# @return [Integer]
|
11
|
+
attr_reader :id
|
12
|
+
|
13
|
+
# @!visibility private
|
14
|
+
def initialize(id)
|
15
|
+
@id = id
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rublox/derive/user"
|
4
|
+
|
5
|
+
module Rublox
|
6
|
+
module Bases
|
7
|
+
class BaseUser
|
8
|
+
include Derive::User
|
9
|
+
|
10
|
+
# @return [Integer]
|
11
|
+
attr_reader :id
|
12
|
+
|
13
|
+
# @!visibility private
|
14
|
+
def initialize(id)
|
15
|
+
@id = id
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/rublox/derive/group.rb
CHANGED
@@ -1,50 +1,33 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "rublox/models/
|
4
|
-
require "rublox/
|
5
|
-
|
6
|
-
module Rublox
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
# @example
|
35
|
-
# client = Rublox::Client.new
|
36
|
-
# group = client.group_from_id(7384468)
|
37
|
-
# owner_member = group.member_by_user(group.owner)
|
38
|
-
# puts owner_member.role.rank # -> 255
|
39
|
-
# @param user [FullUser, LimitedUser] the user to tie to the group member
|
40
|
-
# @return [GroupMember] the user as a group member object
|
41
|
-
def member_by_user(user)
|
42
|
-
data = @client.http_client.get(
|
43
|
-
URL.endpoint("groups", "v2/users/#{user.id}/groups/roles")
|
44
|
-
)["data"].find { |member_data| member_data["group"]["id"] == @id }
|
45
|
-
raise Errors::MemberNotFoundError.new(user.id, @id) unless data
|
46
|
-
|
47
|
-
GroupMember.new(user, GroupRole.new(data["role"], self, @client), self, @client)
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rublox/models/group_shout"
|
4
|
+
require "rublox/util/api_helper"
|
5
|
+
|
6
|
+
module Rublox
|
7
|
+
module Derive
|
8
|
+
module Group
|
9
|
+
# @return [Models::GroupShout] the new group shout
|
10
|
+
def update_shout(message)
|
11
|
+
Models::GroupShout.new(APIHelper.patch(
|
12
|
+
"https://groups.roblox.com/v1/groups/#{@id}/status",
|
13
|
+
json: { message: message }
|
14
|
+
))
|
15
|
+
end
|
16
|
+
|
17
|
+
def accept_join_request(user_id)
|
18
|
+
APIHelper.post("https://groups.roblox.com/v1/groups/#{@id}/join-requests/users/#{user_id}")
|
19
|
+
nil
|
20
|
+
end
|
21
|
+
|
22
|
+
def decline_join_request(user_id)
|
23
|
+
APIHelper.delete("https://groups.roblox.com/v1/groups/#{@id}/join-requests/users/#{user_id}")
|
24
|
+
nil
|
25
|
+
end
|
26
|
+
|
27
|
+
def kick(user_id)
|
28
|
+
APIHelper.delete("https://groups.roblox.com/v1/groups/#{@id}/users/#{user_id}")
|
29
|
+
nil
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/rublox/derive/user.rb
CHANGED
@@ -1,89 +1,43 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "rublox/util/
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
# puts user.follower_count # -> around 6 million
|
45
|
-
# @return [Integer] the count of how many followers the user has
|
46
|
-
def follower_count
|
47
|
-
@client.http_client.get(
|
48
|
-
URL.endpoint("friends", "/v1/users/#{@id}/followers/count")
|
49
|
-
)["count"]
|
50
|
-
end
|
51
|
-
|
52
|
-
# @example
|
53
|
-
# client = Rublox::Client.new
|
54
|
-
# user = client.user_from_id(1)
|
55
|
-
# puts user.followings_count # -> 0
|
56
|
-
# @return [Integer] the count of how many users the user has followed
|
57
|
-
def followings_count
|
58
|
-
@client.http_client.get(
|
59
|
-
URL.endpoint("friends", "/v1/users/#{@id}/followings/count")
|
60
|
-
)["count"]
|
61
|
-
end
|
62
|
-
|
63
|
-
# @example
|
64
|
-
# client = Rublox::Client.new
|
65
|
-
# user = client.user_from_id(1)
|
66
|
-
# puts user.status # -> "Welcome to Roblox, the Imagination Platform. Make friends, explore, and play games!"
|
67
|
-
# @return [String] the user's status
|
68
|
-
def status
|
69
|
-
@client.http_client.get(
|
70
|
-
URL.endpoint("users", "/v1/users/#{@id}/status")
|
71
|
-
)["status"]
|
72
|
-
end
|
73
|
-
|
74
|
-
# @example
|
75
|
-
# client = Rublox::Client.new
|
76
|
-
# user = client.user_from_id(1)
|
77
|
-
# presence = user.presence
|
78
|
-
# puts presence.last_location # -> "Website"
|
79
|
-
# @return [Presence] the presence state of the user
|
80
|
-
def presence
|
81
|
-
@client.user_presence_from_id(@id)
|
82
|
-
end
|
83
|
-
|
84
|
-
# @return [String] a readable string representation of the user
|
85
|
-
def to_s
|
86
|
-
"User of ID #{@id}, username: #{@username}"
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rublox/util/api_helper"
|
4
|
+
require "rublox/derive/model"
|
5
|
+
|
6
|
+
module Rublox
|
7
|
+
module Derive
|
8
|
+
module User
|
9
|
+
include Model
|
10
|
+
|
11
|
+
# @return [Number] the amount of robux the current authenticated user has
|
12
|
+
def currency
|
13
|
+
APIHelper.get("https://economy.roblox.com/v1/users/#{@id}/currency")["robux"]
|
14
|
+
end
|
15
|
+
|
16
|
+
# @return [Boolean]
|
17
|
+
def premium?
|
18
|
+
APIHelper.get("https://premiumfeatures.roblox.com/v1/users/#{@id}/validate-membership")
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [Integer]
|
22
|
+
def friend_count
|
23
|
+
get_generic_count "friends"
|
24
|
+
end
|
25
|
+
|
26
|
+
# @return [Integer]
|
27
|
+
def follower_count
|
28
|
+
get_generic_count "followers"
|
29
|
+
end
|
30
|
+
|
31
|
+
# @return [Integer]
|
32
|
+
def followings_count
|
33
|
+
get_generic_count "followings"
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def get_generic_count(channel)
|
39
|
+
APIHelper.get("https://friends.roblox.com/v1/users/#{@id}/#{channel}/count")["count"]
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -1,60 +1,55 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "rublox/
|
4
|
-
require "rublox/models/
|
5
|
-
require "rublox/
|
6
|
-
|
7
|
-
module Rublox
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
@client = client
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rublox/derive/group"
|
4
|
+
require "rublox/models/skinny_user"
|
5
|
+
require "rublox/models/group_shout"
|
6
|
+
|
7
|
+
module Rublox
|
8
|
+
module Models
|
9
|
+
class FullGroup
|
10
|
+
include Derive::Group
|
11
|
+
|
12
|
+
# @return [Integer]
|
13
|
+
attr_reader :id
|
14
|
+
# @return [String]
|
15
|
+
attr_reader :name
|
16
|
+
# @return [String]
|
17
|
+
attr_reader :description
|
18
|
+
# @return [SkinnyUser]
|
19
|
+
attr_reader :owner
|
20
|
+
# @return [GroupShout]
|
21
|
+
attr_reader :shout
|
22
|
+
# @return [Integer]
|
23
|
+
attr_reader :member_count
|
24
|
+
# @return [Boolean]
|
25
|
+
attr_reader :is_builders_club_only
|
26
|
+
# @return [Boolean]
|
27
|
+
attr_reader :public_entry_allowed
|
28
|
+
# @return [Boolean]
|
29
|
+
attr_reader :is_locked
|
30
|
+
# @return [Boolean]
|
31
|
+
attr_reader :has_verified_badge
|
32
|
+
|
33
|
+
# @!visibility private
|
34
|
+
def initialize(data)
|
35
|
+
owner_data = data["owner"]
|
36
|
+
shout_data = data["shout"]
|
37
|
+
@id = data["id"]
|
38
|
+
@name = data["name"]
|
39
|
+
@description = data["description"]
|
40
|
+
@owner = SkinnyUser.new(owner_data) if owner_data
|
41
|
+
@shout = GroupShout.new(shout_data) if shout_data
|
42
|
+
@member_count = data["memberCount"]
|
43
|
+
@is_builders_club_only = data["isBuildersClubOnly"]
|
44
|
+
@public_entry_allowed = data["publicEntryAllowed"]
|
45
|
+
@is_locked = !data["isLocked"].nil?
|
46
|
+
@has_verified_badge = data["hasVerifiedBadge"]
|
47
|
+
end
|
48
|
+
|
49
|
+
# Updates the group shout and sets {#shout} to the new group shout
|
50
|
+
def update_shout!(message)
|
51
|
+
@shout = update_shout(message)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|