Class: SocialProfile::People::Google
- Inherits:
-
SocialProfile::Person
- Object
- SocialProfile::Person
- SocialProfile::People::Google
- Defined in:
- lib/social_profile/people/google.rb
Instance Attribute Summary
Attributes inherited from SocialProfile::Person
Instance Method Summary collapse
- #channels ⇒ Object
-
#friends_count ⇒ Object
Get friends count.
Methods inherited from SocialProfile::Person
#album!, #fetch_album, #find_album, #find_or_create_album, #followers_count, get, #initialize, #share_photo!, #tag_object!
Constructor Details
This class inherits a constructor from SocialProfile::Person
Instance Method Details
#channels ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/social_profile/people/google.rb', line 15 def channels return @channels if @channels _channels = client.list_channels('statistics', mine: true) @channels = if _channels.respond_to?(:items) _channels elsif _channels.is_a?(String) JSON.parse(_channels, object_class: OpenStruct) end @channels end |
#friends_count ⇒ Object
Get friends count
9 10 11 12 13 |
# File 'lib/social_profile/people/google.rb', line 9 def friends_count @friends_count ||= channels.items.map do |item| (item.statistics.subscriber_count || item.statistics.subscriberCount).to_i end.sum end |