Class: Genius::Account
Instance Attribute Summary collapse
-
#about_me ⇒ Object
readonly
Returns the value of attribute about_me.
-
#artist ⇒ Object
readonly
Returns the value of attribute artist.
-
#avatar ⇒ Object
readonly
Returns the value of attribute avatar.
-
#current_user_metadata ⇒ Object
readonly
Returns the value of attribute current_user_metadata.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#iq ⇒ Object
readonly
Returns the value of attribute iq.
-
#login ⇒ Object
readonly
Returns the value of attribute login.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#role_for_display ⇒ Object
readonly
Returns the value of attribute role_for_display.
-
#tracking_paths ⇒ Object
readonly
Returns the value of attribute tracking_paths.
-
#unread_main_activity_inbox_count ⇒ Object
readonly
Returns the value of attribute unread_main_activity_inbox_count.
-
#unread_messages_count ⇒ Object
readonly
Returns the value of attribute unread_messages_count.
Attributes inherited from Resource
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Resource
default_headers, default_params, from_hash, handle_response, http_delete, http_get, http_post, http_put, #initialize, resource_name
Constructor Details
This class inherits a constructor from Genius::Resource
Instance Attribute Details
#about_me ⇒ Object (readonly)
Returns the value of attribute about_me.
5 6 7 |
# File 'lib/genius/account.rb', line 5 def about_me @about_me end |
#artist ⇒ Object (readonly)
Returns the value of attribute artist.
5 6 7 |
# File 'lib/genius/account.rb', line 5 def artist @artist end |
#avatar ⇒ Object (readonly)
Returns the value of attribute avatar.
5 6 7 |
# File 'lib/genius/account.rb', line 5 def avatar @avatar end |
#current_user_metadata ⇒ Object (readonly)
Returns the value of attribute current_user_metadata.
5 6 7 |
# File 'lib/genius/account.rb', line 5 def @current_user_metadata end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/genius/account.rb', line 5 def id @id end |
#iq ⇒ Object (readonly)
Returns the value of attribute iq.
5 6 7 |
# File 'lib/genius/account.rb', line 5 def iq @iq end |
#login ⇒ Object (readonly)
Returns the value of attribute login.
5 6 7 |
# File 'lib/genius/account.rb', line 5 def login @login end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/genius/account.rb', line 5 def name @name end |
#role_for_display ⇒ Object (readonly)
Returns the value of attribute role_for_display.
5 6 7 |
# File 'lib/genius/account.rb', line 5 def role_for_display @role_for_display end |
#tracking_paths ⇒ Object (readonly)
Returns the value of attribute tracking_paths.
5 6 7 |
# File 'lib/genius/account.rb', line 5 def tracking_paths @tracking_paths end |
#unread_main_activity_inbox_count ⇒ Object (readonly)
Returns the value of attribute unread_main_activity_inbox_count.
5 6 7 |
# File 'lib/genius/account.rb', line 5 def unread_main_activity_inbox_count @unread_main_activity_inbox_count end |
#unread_messages_count ⇒ Object (readonly)
Returns the value of attribute unread_messages_count.
5 6 7 |
# File 'lib/genius/account.rb', line 5 def @unread_messages_count end |
Class Method Details
.find ⇒ Object
29 30 31 |
# File 'lib/genius/account.rb', line 29 def self.find(*) raise NotImplementedError, "An Account cannot be loaded by its ID in the public API" end |
.me(params = {}) ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/genius/account.rb', line 33 def self.me(params = {}) headers = default_headers.merge(params.delete(:headers) || {}) params = default_params.merge(params) new(http_get("/account", query: params, headers: headers), text_format: params[:text_format]) end |
Instance Method Details
#parse_resource! ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/genius/account.rb', line 9 def parse_resource! @unread_messages_count = resource["unread_messages_count"] @artist = resource["artist"] @role_for_display = resource["role_for_display"] @unread_main_activity_inbox_count = resource["unread_main_activity_inbox_count"] @avatar = resource["avatar"] @about_me = formatted_attribute("about_me") @identities = resource["identities"] @name = resource["name"] @tracking_paths = resource["tracking_paths"] @id = resource["id"] @current_user_metadata = resource["current_user_metadata"] @iq = resource["iq"] @login = resource["login"] end |
#reload ⇒ Object
25 26 27 |
# File 'lib/genius/account.rb', line 25 def reload raise NotReloadableError, "An Account cannot be reloaded" end |