Sha256: cab9725834aa8b6b59434b33c105e537ba7d42a9eee774e8dad36f37f549e1c5

Contents?: true

Size: 511 Bytes

Versions: 9

Compression:

Stored size: 511 Bytes

Contents

module Sinatra::FanforceHelpers
  require 'fanforce/api'

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

  def ff
    return @ff if @ff.present?
    @ff = Fanforce::API.new(params)
    @ff.auth(Sinatra::FanforceHelpers.find_api_key(ff.params[:organization_id]))
    @ff
  end

  def self.find_api_key(organization_id, addon_type=:plugin, addon_id=FanforcePlugin._id)
    $Redis.get("installed:#{addon_type}-#{addon_id}:#{organization_id}")
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
fanforce-plugin-factory-0.41.0 lib/fanforce/plugin_factory/config/helpers/fanforce.rb
fanforce-plugin-factory-0.40.0 lib/fanforce/plugin_factory/config/helpers/fanforce.rb
fanforce-plugin-factory-0.39.1 lib/fanforce/plugin_factory/config/helpers/fanforce.rb
fanforce-plugin-factory-0.39.0 lib/fanforce/plugin_factory/config/helpers/fanforce.rb
fanforce-plugin-factory-0.38.2 lib/fanforce/plugin_factory/config/helpers/fanforce.rb
fanforce-plugin-factory-0.38.1 lib/fanforce/plugin_factory/config/helpers/fanforce.rb
fanforce-plugin-factory-0.38.0 lib/fanforce/plugin_factory/config/helpers/fanforce.rb
fanforce-plugin-factory-0.37.1 lib/fanforce/plugin_factory/config/helpers/fanforce.rb
fanforce-plugin-factory-0.37.0 lib/fanforce/plugin_factory/config/helpers/fanforce.rb