Module: Decorators

Defined in:
lib/decorators.rb,
lib/decorators/paths.rb,
lib/decorators/railtie.rb

Defined Under Namespace

Classes: Paths, Railtie

Class Method Summary collapse

Class Method Details

.decoratorsObject


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

def decorators
  paths.registered.map { |path| find_decorators_in_path(path) }.flatten.uniq
end

.load!(cache_classes) ⇒ Object


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

def load!(cache_classes)
  decorators.each do |decorator|
    if cache_classes
      require decorator
    else
      load decorator
    end
  end
end

.register!(*paths_to_register) ⇒ Object


19
20
21
22
23
# File 'lib/decorators.rb', line 19

def register!(*paths_to_register)
  paths_to_register.flatten.map do |path|
    paths.register! path
  end
end