Class: Lotus::Config::Assets Private

Inherits:
Utils::LoadPaths
  • Object
show all
Defined in:
lib/lotus/config/assets.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Assets configuration

Since:

  • 0.1.0

Constant Summary collapse

DEFAULT_DIRECTORY =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

'public'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(root) ⇒ Assets

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Assets.

Since:

  • 0.1.0



12
13
14
15
# File 'lib/lotus/config/assets.rb', line 12

def initialize(root)
  @root = root
  @paths = Array(DEFAULT_DIRECTORY)
end

Instance Method Details

#any?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

Since:

  • 0.2.0



31
32
33
# File 'lib/lotus/config/assets.rb', line 31

def any?
  @paths.any?
end

#entriesObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



19
20
21
22
23
24
25
26
27
# File 'lib/lotus/config/assets.rb', line 19

def entries
  hash = Hash.new { |k, v| k[v] = [] }
  each do |path|
    if path.exist?
      hash[path.to_s] = path.children.map { |child| "/#{ child.basename }" }
    end
  end
  hash
end