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.
66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/discordrb/data.rb', line 66 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.
64 65 66 |
# File 'lib/discordrb/data.rb', line 64 def id @id end |
#members ⇒ Object (readonly)
Returns the value of attribute members.
64 65 66 |
# File 'lib/discordrb/data.rb', line 64 def members @members end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
64 65 66 |
# File 'lib/discordrb/data.rb', line 64 def name @name end |
#owner_id ⇒ Object (readonly)
Returns the value of attribute owner_id.
64 65 66 |
# File 'lib/discordrb/data.rb', line 64 def owner_id @owner_id end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
64 65 66 |
# File 'lib/discordrb/data.rb', line 64 def region @region end |