Class: ViewModel::AccessControl::Composed::PermissionsCheck

Inherits:
Struct
  • Object
show all
Defined in:
lib/view_model/access_control/composed.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#checkerObject

Returns the value of attribute checker

Returns:

  • (Object)

    the current value of checker



53
54
55
# File 'lib/view_model/access_control/composed.rb', line 53

def checker
  @checker
end

#error_typeObject

Returns the value of attribute error_type

Returns:

  • (Object)

    the current value of error_type



53
54
55
# File 'lib/view_model/access_control/composed.rb', line 53

def error_type
  @error_type
end

#locationObject

Returns the value of attribute location

Returns:

  • (Object)

    the current value of location



53
54
55
# File 'lib/view_model/access_control/composed.rb', line 53

def location
  @location
end

#reasonObject

Returns the value of attribute reason

Returns:

  • (Object)

    the current value of reason



53
54
55
# File 'lib/view_model/access_control/composed.rb', line 53

def reason
  @reason
end

Instance Method Details

#check(env) ⇒ Object



58
59
60
# File 'lib/view_model/access_control/composed.rb', line 58

def check(env)
  env.instance_exec(&self.checker)
end

#nameObject



54
55
56
# File 'lib/view_model/access_control/composed.rb', line 54

def name
  "#{reason} (#{location})"
end