Class: CanTango::Permit::User

Inherits:
Base
  • Object
show all
Defined in:
lib/cantango/permit/user.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#ability, #disabled, #mode

Class Method Summary collapse

Instance Method Summary collapse

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) ⇒ User

creates the permit

Parameters:

  • the (Permits::Ability)

    ability

  • the (Hash)

    options



9
10
11
# File 'lib/cantango/permit/user.rb', line 9

def initialize ability
  super
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



4
5
6
# File 'lib/cantango/permit/user.rb', line 4

def key
  @key
end

#match_valueObject

Returns the value of attribute match_value.



4
5
6
# File 'lib/cantango/permit/user.rb', line 4

def match_value
  @match_value
end

Class Method Details

.hash_keyObject



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

def self.hash_key
  nil
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


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

def valid?
  debug_invalid if !match?
  true
end