lib/yammer-oauth2/client.rb in yammer-oauth2-0.1.1 vs lib/yammer-oauth2/client.rb in yammer-oauth2-0.2.0

- old
+ new

@@ -1,14 +1,20 @@ require 'oauth2' module YammerOAuth2 class Client < OAuth2::Client - def initialize(*args) - super + DEFAULT_URL = 'https://www.yammer.com' + + def initialize(client_id, client_secret, opts={}) + site_url = opts.delete(:site_url) || DEFAULT_URL + super(site_url, client_id, client_secret, opts) @token_path = '/oauth2/token' @authorize_path = '/dialog/oauth/authorize' + yield self if block_given? + self end + # Generates the Yammer URL that the user will be redirected to in order to # authorize your application # # @see https://developer.yammer.com/api/oauth2.html#client-side # \ No newline at end of file