Class: Recurso::Global

Inherits:
Object
  • Object
show all
Includes:
Resource, Singleton
Defined in:
lib/recurso/models/global.rb

Instance Method Summary collapse

Methods included from Resource

included, #policy_class, #policy_type, #policy_type=, #relevant_levels_for, #relevant_policy_type, #relevant_resources

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method) ⇒ Object



15
16
17
18
19
# File 'lib/recurso/models/global.rb', line 15

def method_missing(method)
  super unless Recurso::Config.instance.global_relations.include?(method)

  method.to_s.classify.constantize.all
end

Instance Method Details

#permission_policyObject



11
12
13
# File 'lib/recurso/models/global.rb', line 11

def permission_policy
  OpenStruct.new(policy_type: :open)
end