Class: Discordrb::Server
- Inherits:
-
Object
- Object
- Discordrb::Server
- Defined in:
- lib/discordrb/data.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#members ⇒ Object
readonly
Returns the value of attribute members.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#owner_id ⇒ Object
readonly
Returns the value of attribute owner_id.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
Instance Method Summary collapse
-
#initialize(data, bot) ⇒ Server
constructor
A new instance of Server.
Constructor Details
#initialize(data, bot) ⇒ Server
Returns a new instance of Server.
88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/discordrb/data.rb', line 88 def initialize(data, bot) @bot = bot @region = data['region'] @name = data['name'] @owner_id = data['owner_id'].to_i @id = data['id'].to_i @members = [] data['members'].each do |element| @members << User.new(element, bot) end end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
86 87 88 |
# File 'lib/discordrb/data.rb', line 86 def id @id end |
#members ⇒ Object (readonly)
Returns the value of attribute members.
86 87 88 |
# File 'lib/discordrb/data.rb', line 86 def members @members end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
86 87 88 |
# File 'lib/discordrb/data.rb', line 86 def name @name end |
#owner_id ⇒ Object (readonly)
Returns the value of attribute owner_id.
86 87 88 |
# File 'lib/discordrb/data.rb', line 86 def owner_id @owner_id end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
86 87 88 |
# File 'lib/discordrb/data.rb', line 86 def region @region end |