Class: Guts::IndexPolicy

Inherits:
Struct
  • Object
show all
Defined in:
app/policies/guts/index_policy.rb

Overview

Index policy (headless)

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#indexObject

Returns the value of attribute index

Returns:

  • (Object)

    the current value of index



3
4
5
# File 'app/policies/guts/index_policy.rb', line 3

def index
  @index
end

#userObject

Returns the value of attribute user

Returns:

  • (Object)

    the current value of user



3
4
5
# File 'app/policies/guts/index_policy.rb', line 3

def user
  @user
end

Instance Method Details

#index?Boolean

Policy for index method

Returns:

  • (Boolean)

    allowed or denied



6
7
8
# File 'app/policies/guts/index_policy.rb', line 6

def index?
  !user.nil?
end