Class: CanTango::Config::Permits::Types

Inherits:
Registry::Base
  • Object
show all
Includes:
Singleton
Defined in:
lib/cantango/permits_ext/config/permits/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#enabledObject



12
13
14
# File 'lib/cantango/permits_ext/config/permits/types.rb', line 12

def enabled
  @enabled || available
end

Instance Method Details

#availableObject



8
9
10
# File 'lib/cantango/permits_ext/config/permits/types.rb', line 8

def available
  registered
end

#disable(*types) ⇒ Object



16
17
18
# File 'lib/cantango/permits_ext/config/permits/types.rb', line 16

def disable *types
  @enabled = available - registered.flatten
end

#enable_all!Object



20
21
22
# File 'lib/cantango/permits_ext/config/permits/types.rb', line 20

def enable_all!
  @enabled = available
end