Module: Freelancer::Rails::Controllers::Helpers

Included in:
AuthorizationsController
Defined in:
lib/freelancer-rails/controllers/helpers.rb

Instance Method Summary collapse

Instance Method Details

#freelancer_access_secretObject

Returns the current access secret from the user session



27
28
29
# File 'lib/freelancer-rails/controllers/helpers.rb', line 27

def freelancer_access_secret
  session["freelancer_oauth_access_secret"]
end

#freelancer_access_secret?Boolean

Returns true if the current user session contains an access secret

Returns:

  • (Boolean)


22
23
24
# File 'lib/freelancer-rails/controllers/helpers.rb', line 22

def freelancer_access_secret?
  freelancer_access_secret != nil
end

#freelancer_access_tokenObject

Returns the current access token from the user session



17
18
19
# File 'lib/freelancer-rails/controllers/helpers.rb', line 17

def freelancer_access_token
  session["freelancer_oauth_access_token"]
end

#freelancer_access_token?Boolean

Returns true if the current user session contains an access token

Returns:

  • (Boolean)


12
13
14
# File 'lib/freelancer-rails/controllers/helpers.rb', line 12

def freelancer_access_token?
  freelancer_access_token != nil          
end

#freelancer_clientObject

Returns the current instance of the Freelancer Client



7
8
9
# File 'lib/freelancer-rails/controllers/helpers.rb', line 7

def freelancer_client
  @freelancer_client ||= Freelancer::Client.new(Freelancer::Rails::Configuration.api_token, Freelancer::Rails::Configuration.api_secret, :sandbox => Freelancer::Rails::Configuration.sandbox_mode?)
end