Module: FlightConfig::Indexable

Includes:
Globber, Reader
Defined in:
lib/flight_config/indexable.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary

Constants included from Core

Core::PLACEHOLDER

Instance Attribute Summary

Attributes included from Core

#__inputs__, #__read_mode__

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Core

#__data__initialize, #__registry__, #initialize, lock, log, #path, read, write

Class Method Details

.included(base) ⇒ Object



36
37
38
# File 'lib/flight_config/indexable.rb', line 36

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#__data__Object



64
65
66
67
68
69
70
71
72
73
# File 'lib/flight_config/indexable.rb', line 64

def __data__
  @__data__ ||= begin
    if __read_mode__ && !valid?
      FlightConfig::Core.log(self, 'Removing index')
      FileUtils.rm_f path
      raise InvalidIndex, 'Failed to load index as it is invalid'
    end
    {}
  end
end

#valid?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


60
61
62
# File 'lib/flight_config/indexable.rb', line 60

def valid?
  raise NotImplementedError
end