Class: PixivApi::Response::Friend
- Inherits:
-
Identity
- Object
- PixivApi::Response
- Identity
- PixivApi::Response::Friend
- Defined in:
- lib/pixiv_api/response/friend.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
Returns the value of attribute account.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Attributes inherited from PixivApi::Response
Instance Method Summary collapse
- #avatar_url ⇒ Object
-
#initialize(response, attributes) ⇒ Friend
constructor
A new instance of Friend.
Methods inherited from PixivApi::Response
#[], attr_reader, define_attribute_method, define_attributes_method, define_blob_method, define_time_method, from_response
Constructor Details
#initialize(response, attributes) ⇒ Friend
Returns a new instance of Friend.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/pixiv_api/response/friend.rb', line 8 def initialize(response, attributes) user_id = attributes['user'].delete('id') merged = attributes['user'].merge( id: attributes['id'], user_id: user_id ) super(response, merged) end |
Instance Attribute Details
#account ⇒ Object (readonly)
Returns the value of attribute account.
4 5 6 |
# File 'lib/pixiv_api/response/friend.rb', line 4 def account @account end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/pixiv_api/response/friend.rb', line 4 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/pixiv_api/response/friend.rb', line 4 def name @name end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
4 5 6 |
# File 'lib/pixiv_api/response/friend.rb', line 4 def user_id @user_id end |
Instance Method Details
#avatar_url ⇒ Object
19 20 21 |
# File 'lib/pixiv_api/response/friend.rb', line 19 def avatar_url blob_profile_image_urls['px_50x50'] end |