lib/omniauth/strategies/foursquare.rb in chronicle-foursquare-0.1.1 vs lib/omniauth/strategies/foursquare.rb in chronicle-foursquare-0.2.0

- old
+ new

@@ -9,42 +9,46 @@ module OmniAuth module Strategies class Foursquare < OmniAuth::Strategies::OAuth2 option :client_options, { - :site => 'https://foursquare.com', - :authorize_url => '/oauth2/authenticate', - :token_url => '/oauth2/access_token' + site: 'https://foursquare.com', + authorize_url: '/oauth2/authenticate', + token_url: '/oauth2/access_token' } uid { raw_info['id'] } info do { - :first_name => raw_info['firstName'], - :last_name => raw_info['lastName'], - :name => "#{raw_info['firstName']} #{raw_info['lastName']}", - :email => (raw_info['contact'] || {})['email'], - :phone => (raw_info['contact'] || {})['phone'], - :image => raw_info['photo'], - :location => raw_info['homeCity'], - :description => raw_info['bio'] + first_name: raw_info['firstName'], + last_name: raw_info['lastName'], + name: "#{raw_info['firstName']} #{raw_info['lastName']}", + email: (raw_info['contact'] || {})['email'], + phone: (raw_info['contact'] || {})['phone'], + image: raw_info['photo'], + location: raw_info['homeCity'], + description: raw_info['bio'] } end extra do - { :raw_info => raw_info } + { raw_info: raw_info } end def request_phase options[:authorize_params] = client_params.merge(options[:authorize_params]) super end def auth_hash - OmniAuth::Utils.deep_merge(super, client_params.merge({ - :grant_type => 'authorization_code'})) + OmniAuth::Utils.deep_merge(super, + client_params.merge( + { + grant_type: 'authorization_code' + } + )) end def raw_info access_token.options[:mode] = :query access_token.options[:param_name] = :oauth_token @@ -52,10 +56,10 @@ end private def client_params - {:client_id => options[:client_id], :redirect_uri => callback_url ,:response_type => "code"} + { client_id: options[:client_id], redirect_uri: callback_url, response_type: 'code' } end end end end