Class: InstagramUser
- Inherits:
-
Object
- Object
- InstagramUser
- Defined in:
- lib/instagram_user.rb
Instance Attribute Summary collapse
-
#follower_count ⇒ Object
Returns the value of attribute follower_count.
-
#is_private ⇒ Object
Returns the value of attribute is_private.
-
#media_json ⇒ Object
Returns the value of attribute media_json.
-
#profile_pic_url ⇒ Object
Returns the value of attribute profile_pic_url.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
Instance Attribute Details
#follower_count ⇒ Object
Returns the value of attribute follower_count.
2 3 4 |
# File 'lib/instagram_user.rb', line 2 def follower_count @follower_count end |
#is_private ⇒ Object
Returns the value of attribute is_private.
2 3 4 |
# File 'lib/instagram_user.rb', line 2 def is_private @is_private end |
#media_json ⇒ Object
Returns the value of attribute media_json.
2 3 4 |
# File 'lib/instagram_user.rb', line 2 def media_json @media_json end |
#profile_pic_url ⇒ Object
Returns the value of attribute profile_pic_url.
2 3 4 |
# File 'lib/instagram_user.rb', line 2 def profile_pic_url @profile_pic_url end |
#username ⇒ Object
Returns the value of attribute username.
2 3 4 |
# File 'lib/instagram_user.rb', line 2 def username @username end |
Instance Method Details
#avg_likes ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/instagram_user.rb', line 3 def avg_likes #code items = @media_json['items'] total = items.length sum_likes = items.inject(0){|s, post| s + post['likes']['count']} @avg = sum_likes/total end |