Class: GoogleReaderApi::User

Inherits:
Object
  • Object
show all
Defined in:
lib/google-reader-api-uniq/user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ User

specify either the :email and :password or the :auth token you got in the past

:email

the user’s email address for login purposes

:password

the user’s password for login purposes

:auth

the auth token you got from a previous authentication request if you provide this you do not need to provide the email and password



17
18
19
# File 'lib/google-reader-api-uniq/user.rb', line 17

def initialize(options)
  @api = GoogleReaderApi::Api::new options
end

Instance Attribute Details

#apiObject (readonly)

maybe someone would like to access the api for a user



7
8
9
# File 'lib/google-reader-api-uniq/user.rb', line 7

def api
  @api
end

Instance Method Details

#feedsObject



29
30
31
# File 'lib/google-reader-api-uniq/user.rb', line 29

def feeds
  subscriptions.feeds
end

#infoObject



21
22
23
# File 'lib/google-reader-api-uniq/user.rb', line 21

def info
  JSON[api.get_link "api/0/user-info"]
end

#subscriptionsObject



25
26
27
# File 'lib/google-reader-api-uniq/user.rb', line 25

def subscriptions
  @subscriptions ||= GoogleReaderApi::SubscriptionList.new @api
end