Module: Freelancer::Rails::Controllers::Helpers
- Included in:
- AuthorizationsController
- Defined in:
- lib/freelancer-rails/controllers/helpers.rb
Instance Method Summary collapse
-
#freelancer_access_secret ⇒ Object
Returns the current access secret from the user session.
-
#freelancer_access_secret? ⇒ Boolean
Returns true if the current user session contains an access secret.
-
#freelancer_access_token ⇒ Object
Returns the current access token from the user session.
-
#freelancer_access_token? ⇒ Boolean
Returns true if the current user session contains an access token.
-
#freelancer_client ⇒ Object
Returns the current instance of the Freelancer Client.
Instance Method Details
#freelancer_access_secret ⇒ Object
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
22 23 24 |
# File 'lib/freelancer-rails/controllers/helpers.rb', line 22 def freelancer_access_secret? freelancer_access_secret != nil end |
#freelancer_access_token ⇒ Object
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
12 13 14 |
# File 'lib/freelancer-rails/controllers/helpers.rb', line 12 def freelancer_access_token? freelancer_access_token != nil end |
#freelancer_client ⇒ Object
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 |