Sha256: ca0adb136309602aa3c319b3d300d7e99328080ed0407c011dddb42a75d64397

Contents?: true

Size: 571 Bytes

Versions: 1

Compression:

Stored size: 571 Bytes

Contents

module Flippeur

  module ViewHelpers
    def feature?(name)
      available = Flippeur.find(name).available? @controller.current_person
      block_given? ? (yield if available) : available
    end
  end

  module ControllerHelpers
    def feature?(name)
      available = Flippeur.find(name).available? current_person
      block_given? ? (yield if available) : available
    end
  end

  module ModelHelpers
    def feature?(name, person)
      available = Flippeur.find(name).available? person
      block_given? ? (yield if available) : available
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flippeur-1.0.0 lib/flippeur/rails_helpers.rb