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



69
70
71
# File 'lib/view_model/access_control/composed.rb', line 69

def checker
  @checker
end

#error_typeObject

Returns the value of attribute error_type

Returns:

  • (Object)

    the current value of error_type



69
70
71
# File 'lib/view_model/access_control/composed.rb', line 69

def error_type
  @error_type
end

#locationObject

Returns the value of attribute location

Returns:

  • (Object)

    the current value of location



69
70
71
# File 'lib/view_model/access_control/composed.rb', line 69

def location
  @location
end

#reasonObject

Returns the value of attribute reason

Returns:

  • (Object)

    the current value of reason



69
70
71
# File 'lib/view_model/access_control/composed.rb', line 69

def reason
  @reason
end

Instance Method Details

#check(env) ⇒ Object



74
75
76
# File 'lib/view_model/access_control/composed.rb', line 74

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

#nameObject



70
71
72
# File 'lib/view_model/access_control/composed.rb', line 70

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