Class: Rubord::Application
- Inherits:
-
Object
- Object
- Rubord::Application
- Defined in:
- lib/rubord/models/application.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#emojis ⇒ Object
readonly
Returns the value of attribute emojis.
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
Instance Method Summary collapse
-
#initialize(data, client) ⇒ Application
constructor
A new instance of Application.
- #inspect ⇒ Object
Constructor Details
#initialize(data, client) ⇒ Application
Returns a new instance of Application.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rubord/models/application.rb', line 9 def initialize(data, client) @client = client @id = data["id"] @name = data["name"] @icon = data["icon"] @description = data["description"] @owner = Rubord::User.new(data["owner"]) client.users.set(@owner.id, @owner) @emojis = [] fetched_emojis = client.rest.get_application_emojis(@id)["items"] || [] fetched_emojis.each do |emoji_data| @emojis << Rubord::Emoji.new(emoji_data, client) end end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
3 4 5 |
# File 'lib/rubord/models/application.rb', line 3 def description @description end |
#emojis ⇒ Object (readonly)
Returns the value of attribute emojis.
3 4 5 |
# File 'lib/rubord/models/application.rb', line 3 def emojis @emojis end |
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
3 4 5 |
# File 'lib/rubord/models/application.rb', line 3 def icon @icon end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/rubord/models/application.rb', line 3 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/rubord/models/application.rb', line 3 def name @name end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
3 4 5 |
# File 'lib/rubord/models/application.rb', line 3 def owner @owner end |
Instance Method Details
#inspect ⇒ Object
26 27 28 |
# File 'lib/rubord/models/application.rb', line 26 def inspect "#<Rubord::Application id=#{@id}" end |