Class: Rubycord::IntegrationApplication

Inherits:
Object
  • Object
show all
Defined in:
lib/rubycord/data/integration.rb

Overview

Bot/OAuth2 application for discord integrations

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, bot) ⇒ IntegrationApplication

Returns a new instance of IntegrationApplication.



36
37
38
39
40
41
42
43
# File 'lib/rubycord/data/integration.rb', line 36

def initialize(data, bot)
  @id = data["id"].to_i
  @name = data["name"]
  @icon = data["icon"]
  @description = data["description"]
  @summary = data["summary"]
  @bot = Rubycord::User.new(data["user"], bot) if data["user"]
end

Instance Attribute Details

#botUser? (readonly)

Returns the bot associated with this application.

Returns:

  • (User, nil)

    the bot associated with this application.



34
35
36
# File 'lib/rubycord/data/integration.rb', line 34

def bot
  @bot
end

#descriptionString (readonly)

Returns the description of the application.

Returns:

  • (String)

    the description of the application.



28
29
30
# File 'lib/rubycord/data/integration.rb', line 28

def description
  @description
end

#iconString? (readonly)

Returns the icon hash of the application.

Returns:

  • (String, nil)

    the icon hash of the application.



25
26
27
# File 'lib/rubycord/data/integration.rb', line 25

def icon
  @icon
end

#idInteger (readonly)

Returns the ID of the application.

Returns:

  • (Integer)

    the ID of the application.



19
20
21
# File 'lib/rubycord/data/integration.rb', line 19

def id
  @id
end

#nameString (readonly)

Returns the name of the application.

Returns:

  • (String)

    the name of the application.



22
23
24
# File 'lib/rubycord/data/integration.rb', line 22

def name
  @name
end

#summaryString (readonly)

Returns the summary of the application.

Returns:

  • (String)

    the summary of the application.



31
32
33
# File 'lib/rubycord/data/integration.rb', line 31

def summary
  @summary
end