Class: Discordrb::Invite
- Inherits:
-
Object
- Object
- Discordrb::Invite
- Defined in:
- lib/discordrb/data.rb
Overview
A Discord invite to a channel
Instance Attribute Summary collapse
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#inviter ⇒ Object
(also: #user)
readonly
Returns the value of attribute inviter.
-
#revoked ⇒ Object
(also: #revoked?)
readonly
Returns the value of attribute revoked.
-
#temporary ⇒ Object
(also: #temporary?)
readonly
Returns the value of attribute temporary.
-
#uses ⇒ Object
(also: #max_uses)
readonly
Returns the value of attribute uses.
-
#xkcd ⇒ Object
(also: #xkcd?)
readonly
Returns the value of attribute xkcd.
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(data, bot) ⇒ Invite
constructor
A new instance of Invite.
Constructor Details
#initialize(data, bot) ⇒ Invite
Returns a new instance of Invite.
269 270 271 272 273 274 275 276 277 278 279 280 |
# File 'lib/discordrb/data.rb', line 269 def initialize(data, bot) @bot = bot @channel = Channel.new(data['channel'], bot) @uses = data['uses'] @inviter = @bot.user(data['inviter']['id'].to_i) || User.new(data['inviter'], bot) @temporary = data['temporary'] @revoked = data['revoked'] @xkcd = data['xkcdpass'] @code = data['code'] end |
Instance Attribute Details
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
259 260 261 |
# File 'lib/discordrb/data.rb', line 259 def channel @channel end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
259 260 261 |
# File 'lib/discordrb/data.rb', line 259 def code @code end |
#inviter ⇒ Object (readonly) Also known as: user
Returns the value of attribute inviter.
259 260 261 |
# File 'lib/discordrb/data.rb', line 259 def inviter @inviter end |
#revoked ⇒ Object (readonly) Also known as: revoked?
Returns the value of attribute revoked.
259 260 261 |
# File 'lib/discordrb/data.rb', line 259 def revoked @revoked end |
#temporary ⇒ Object (readonly) Also known as: temporary?
Returns the value of attribute temporary.
259 260 261 |
# File 'lib/discordrb/data.rb', line 259 def temporary @temporary end |
#uses ⇒ Object (readonly) Also known as: max_uses
Returns the value of attribute uses.
259 260 261 |
# File 'lib/discordrb/data.rb', line 259 def uses @uses end |
#xkcd ⇒ Object (readonly) Also known as: xkcd?
Returns the value of attribute xkcd.
259 260 261 |
# File 'lib/discordrb/data.rb', line 259 def xkcd @xkcd end |
Instance Method Details
#delete ⇒ Object
282 283 284 |
# File 'lib/discordrb/data.rb', line 282 def delete API.delete_invite(@bot.token, @code) end |