Class: DBio::DiscordConnection
- Inherits:
-
Object
- Object
- DBio::DiscordConnection
- Defined in:
- lib/dbio/discord_connection.rb
Overview
Find information about a Discord Connection.
Instance Method Summary collapse
-
#icon ⇒ String
The icon is used on the website, it's a Font Awesome icon code.
-
#initialize(data) ⇒ DiscordConnection
constructor
Initialize the connection.
-
#name ⇒ String
The name as it appears on the Discord profile.
-
#type ⇒ String
The type of Discord connection, e.g.
-
#url ⇒ String
The URL to the connection as it is on the Discord profile.
Constructor Details
#initialize(data) ⇒ DiscordConnection
Initialize the connection
4 5 6 |
# File 'lib/dbio/discord_connection.rb', line 4 def initialize(data) @data = data end |
Instance Method Details
#icon ⇒ String
The icon is used on the website, it's a Font Awesome icon code. Not really useful unless you're making a site with the gem, in which case you'd probably do: <a href=“<%= @connection.url %>”><i class=“<%= @connection.icon %>”></i> <%= @connection.name %></a> Which could return: <a href=“twitter.com/twitter”> class=“fab fa-twitter”></i> Twitter</a>
30 31 32 |
# File 'lib/dbio/discord_connection.rb', line 30 def icon @data['icon'] end |
#name ⇒ String
Returns the name as it appears on the Discord profile.
15 16 17 |
# File 'lib/dbio/discord_connection.rb', line 15 def name @data['name'] end |
#type ⇒ String
The type of Discord connection, e.g. Twitter, YouTube, etc.
10 11 12 |
# File 'lib/dbio/discord_connection.rb', line 10 def type @data['connection_type'] end |
#url ⇒ String
Returns the URL to the connection as it is on the Discord profile.
20 21 22 |
# File 'lib/dbio/discord_connection.rb', line 20 def url @data['url'] end |