Module: Plug

Extended by:
Plug
Included in:
Plug
Defined in:
lib/plug.rb,
lib/plug/engine.rb,
lib/plug/version.rb,
app/models/plug/feature.rb,
app/models/plug/application_record.rb,
app/helpers/plug/application_helper.rb,
app/mailers/plug/application_mailer.rb,
app/controllers/plug/features_controller.rb,
app/controllers/plug/application_controller.rb

Defined Under Namespace

Modules: ApplicationHelper Classes: ApplicationController, ApplicationMailer, ApplicationRecord, Engine, Feature, FeaturesController

Constant Summary collapse

VERSION =
'0.1.3'

Instance Method Summary collapse

Instance Method Details

#enabled?(arg) ⇒ Boolean

Returns:



6
7
8
9
10
11
12
# File 'lib/plug.rb', line 6

def enabled?(arg)
  arg = arg.to_s if arg.is_a? Symbol
  feature = Plug::Feature.slug_and_name(arg).first

  return false unless feature
  return feature.enabled?
end