Sha256: 263e2f8d5ccfb759f88b0dab0ff4106f8a4eae7be71513704869372a9ceb0b7f

Contents?: true

Size: 561 Bytes

Versions: 22

Compression:

Stored size: 561 Bytes

Contents

module Sinatra::FanforceHelpers
  require 'fanforce/api'

  def fanforce_id
    @fanforce_id = params[:fanforce_id] || ff.params[:fanforce_id]
  end

  def ff
    return @ff if @ff.present?
    @ff = Fanforce::API.new(params)
    #return @ff if !@ff.valid_fanforce_request? and !@ff.valid_fanforce_js_request?

    @ff.auth Sinatra::FanforceHelpers.find_api_key(ff.params[:fanforce_id])
    @ff
  end

  def self.find_api_key(fanforce_id, addon_type=:app, addon_id=FanforceApp._id)
    $Redis.get("installed:#{addon_type}-#{addon_id}:#{fanforce_id}")
  end

end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
fanforce-app-factory-0.20.2 lib/fanforce/app_factory/config/helpers/fanforce.rb
fanforce-app-factory-0.20.1 lib/fanforce/app_factory/config/helpers/fanforce.rb
fanforce-app-factory-0.20.0 lib/fanforce/app_factory/config/helpers/fanforce.rb
fanforce-app-factory-0.19.4 lib/fanforce/app_factory/config/helpers/fanforce.rb
fanforce-app-factory-0.19.3 lib/fanforce/app_factory/config/helpers/fanforce.rb
fanforce-app-factory-0.19.1 lib/fanforce/app_factory/config/helpers/fanforce.rb
fanforce-app-factory-0.19.0 lib/fanforce/app_factory/config/helpers/fanforce.rb
fanforce-app-factory-0.18.0 lib/fanforce/app_factory/config/helpers/fanforce.rb
fanforce-app-factory-0.17.2 lib/fanforce/app_factory/config/helpers/fanforce.rb
fanforce-app-factory-0.17.1 lib/fanforce/app_factory/config/helpers/fanforce.rb
fanforce-app-factory-0.17.0 lib/fanforce/app_factory/config/helpers/fanforce.rb
fanforce-app-factory-0.16.1 lib/fanforce/app_factory/config/helpers/fanforce.rb
fanforce-app-factory-0.16.0 lib/fanforce/app_factory/config/helpers/fanforce.rb
fanforce-app-factory-0.15.0 lib/fanforce/app_factory/config/helpers/fanforce.rb
fanforce-app-factory-0.14.1 lib/fanforce/app_factory/config/helpers/fanforce.rb
fanforce-app-factory-0.14.0 lib/fanforce/app_factory/config/helpers/fanforce.rb
fanforce-app-factory-0.13.0 lib/fanforce/app_factory/config/helpers/fanforce.rb
fanforce-app-factory-0.12.1 lib/fanforce/app_factory/config/helpers/fanforce.rb
fanforce-app-factory-0.12.0 lib/fanforce/app_factory/config/helpers/fanforce.rb
fanforce-app-factory-0.11.0 lib/fanforce/app_factory/config/helpers/fanforce.rb