lib/omniauth/strategies/yammer.rb in omniauth-yammer-0.0.6 vs lib/omniauth/strategies/yammer.rb in omniauth-yammer-0.0.7
- old
+ new
@@ -50,20 +50,23 @@
def raw_info
@raw_info ||= access_token.get('/api/v1/users/current.json').parsed
end
+ def primary_email
+ raw_info['contact']['email_addresses'].detect{|address| address['type'] == 'primary'}['address'] rescue nil
+ end
+
private
def prune!(hash)
hash.delete_if do |_, value|
prune!(value) if value.is_a?(Hash)
value.nil? || (value.respond_to?(:empty?) && value.empty?)
end
end
- def primary_email
- raw_info['contact']['email_addresses'].detect{|address| address['type'] == 'primary'}['address']
- end
end
end
end
+
+OmniAuth.config.add_camelization 'yammer', 'Yammer'
\ No newline at end of file