Class: Bootscale::CacheBuilder
- Inherits:
-
Object
- Object
- Bootscale::CacheBuilder
- Defined in:
- lib/bootscale/cache_builder.rb
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
Instance Method Summary collapse
- #generate(load_path) ⇒ Object
-
#initialize ⇒ CacheBuilder
constructor
A new instance of CacheBuilder.
Constructor Details
#initialize ⇒ CacheBuilder
Returns a new instance of CacheBuilder.
5 6 7 |
# File 'lib/bootscale/cache_builder.rb', line 5 def initialize @entries = {} end |
Instance Attribute Details
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
3 4 5 |
# File 'lib/bootscale/cache_builder.rb', line 3 def entries @entries end |
Instance Method Details
#generate(load_path) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/bootscale/cache_builder.rb', line 9 def generate(load_path) ordered_entries = load_path.map do |path| path = path.to_s entries[path] ||= Entry.new(path) end Hash[ordered_entries.reverse.flat_map(&:features)] end |