Class: CanTango::PermissionEngine::Loader::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/cantango/permission_engine/loader/base.rb

Direct Known Subclasses

Categories, Permissions

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#file_nameObject

Returns the value of attribute file_name.



5
6
7
# File 'lib/cantango/permission_engine/loader/base.rb', line 5

def file_name
  @file_name
end

Class Method Details

.inherited(subclass) ⇒ Object



7
8
9
# File 'lib/cantango/permission_engine/loader/base.rb', line 7

def self.inherited subclass
  subclass.extend ClassMethods
end

Instance Method Details

#parserObject

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/cantango/permission_engine/loader/base.rb', line 11

def parser
  raise NotImplementedError
end

#yml_contentObject



15
16
17
18
19
# File 'lib/cantango/permission_engine/loader/base.rb', line 15

def yml_content
  YAML.load_file(file_name)
rescue
  raise "Couldn't load permissions file: #{file_name}. Either disable Permission engine or add this file."
end