Class: CanTango::Permit::UserType

Inherits:
Base
  • Object
show all
Extended by:
ClassMethods
Defined in:
lib/cantango/permit/user_type.rb

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary

Attributes inherited from Base

#ability, #disabled, #mode

Instance Method Summary collapse

Methods included from ClassMethods

hash_key

Methods inherited from Base

#any, #category, #disable!, #disabled?, #modes, #name, #permit_type, #sync_rules!

Methods included from ClassMethods

#finder, #hash_key, #inherited, #modes, #type

Methods included from Helper::Naming

#account_name, #permit_name, #permit_type

Constructor Details

#initialize(ability) ⇒ UserType

creates the permit

Parameters:



13
14
15
# File 'lib/cantango/permit/user_type.rb', line 13

def initialize ability
  super
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


17
18
19
20
# File 'lib/cantango/permit/user_type.rb', line 17

def valid?        
  debug_invalid unless user_type == name
  user_type == name
end