Module: OurKudos::Acts::Client::AddActsAsOurKudosClient

Defined in:
lib/ourkudos/acts/client.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_ourkudos_client(options = {:token => :authentication_token}) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/ourkudos/acts/client.rb', line 10

def acts_as_ourkudos_client(options = {:token => :authentication_token})
  
  cattr_reader :application_id, :application_secret, :ourkudos_host

  class_eval <<-RUBY
     include OurKudos::Acts::Client::InstanceMethods

     if defined?(Devise) && Devise.omniauth_configs[:ourkudos]
        @@application_id, @@application_secret = Devise.omniauth_configs[:ourkudos].args[0..1]
        @@ourkudos_host = Devise.omniauth_configs[:ourkudos].args[2][:site]
      else
      raise "Please put correct config in devise initializer i.e. config.omniauth :ourkduos 'app_id', 'app_secret'"
    end
 RUBY

end