Class: FeatherCms::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/feather_cms/config.rb

Class Method Summary collapse

Class Method Details

.init {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



5
6
7
8
9
10
11
12
13
# File 'lib/feather_cms/config.rb', line 5

def init(&block)
  @@config ||= {}

  yield self if block_given? 

  @@config[:layouts] = Dir.entries(Rails.root.to_s + '/app/views/layouts').reject do |i|
    i.start_with?('.', '_') || File.directory?(i)
  end.collect{|l| l.split('.').first}
end

.layoutsObject



15
16
17
# File 'lib/feather_cms/config.rb', line 15

def layouts
  @@config[:layouts]
end