Sha256: 365edab452ae30590037b79512a711ab672554aaf1a800fac122cc009da05414

Contents?: true

Size: 591 Bytes

Versions: 3

Compression:

Stored size: 591 Bytes

Contents

require 'plug/engine'
require 'plug/configuration'
require 'plug/constraint'

module Plug
  extend self
  extend Configuration

  # 
  # [enabled? returns true of false]
  # @param arg [String, Symbol] The slug or name of the Feature
  # 
  # @return [Boolean] true - feature found and enabled | true - feature not found (We don't want to block) | false - feature was set to disabled
  def enabled?(arg)
    arg = arg.to_s if arg.is_a? Symbol
    feature = Plug::Feature.slug_and_name(arg).first

    return true unless feature
    return feature.enabled?
  rescue
    return true
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
plug-0.1.9 lib/plug.rb
plug-0.1.8 lib/plug.rb
plug-0.1.7 lib/plug.rb