Class: Faulty::Options

Inherits:
Struct
  • Object
show all
Includes:
ImmutableOptions
Defined in:
lib/faulty.rb

Overview

Options for Faulty

Instance Attribute Summary collapse

Method Summary

Methods included from ImmutableOptions

#initialize

Instance Attribute Details

#cacheCache::Interface (readonly)

Returns A cache backend if you want to use Faulty's cache support. Automatically wrapped in a Cache::AutoWire. Default Cache::AutoWire.new.

Returns:

  • (Cache::Interface)

    A cache backend if you want to use Faulty's cache support. Automatically wrapped in a Cache::AutoWire. Default Cache::AutoWire.new.

See Also:


143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/faulty.rb', line 143

Options = Struct.new(
  :cache,
  :storage,
  :listeners,
  :notifier
) do
  include ImmutableOptions

  private

  def finalize
    self.notifier ||= Events::Notifier.new(listeners || [])
    self.storage = Storage::AutoWire.new(storage, notifier: notifier)
    self.cache = Cache::AutoWire.new(cache, notifier: notifier)
  end

  def required
    i[cache storage notifier]
  end

  def defaults
    {
      listeners: [Events::LogListener.new]
    }
  end
end

#listenersArray (readonly)

Returns listeners Faulty event listeners.

Returns:

  • (Array)

    listeners Faulty event listeners

See Also:


143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/faulty.rb', line 143

Options = Struct.new(
  :cache,
  :storage,
  :listeners,
  :notifier
) do
  include ImmutableOptions

  private

  def finalize
    self.notifier ||= Events::Notifier.new(listeners || [])
    self.storage = Storage::AutoWire.new(storage, notifier: notifier)
    self.cache = Cache::AutoWire.new(cache, notifier: notifier)
  end

  def required
    i[cache storage notifier]
  end

  def defaults
    {
      listeners: [Events::LogListener.new]
    }
  end
end

#notifierEvents::Notifier (readonly)

Returns A Faulty notifier. If given, listeners are ignored.

Returns:


143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/faulty.rb', line 143

Options = Struct.new(
  :cache,
  :storage,
  :listeners,
  :notifier
) do
  include ImmutableOptions

  private

  def finalize
    self.notifier ||= Events::Notifier.new(listeners || [])
    self.storage = Storage::AutoWire.new(storage, notifier: notifier)
    self.cache = Cache::AutoWire.new(cache, notifier: notifier)
  end

  def required
    i[cache storage notifier]
  end

  def defaults
    {
      listeners: [Events::LogListener.new]
    }
  end
end

#storageStorage::Interface+ (readonly)

backend. Automatically wrapped in a Storage::AutoWire, so this can also be given an array of prioritized backends. Default Storage::AutoWire.new.

Returns:

See Also:


143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/faulty.rb', line 143

Options = Struct.new(
  :cache,
  :storage,
  :listeners,
  :notifier
) do
  include ImmutableOptions

  private

  def finalize
    self.notifier ||= Events::Notifier.new(listeners || [])
    self.storage = Storage::AutoWire.new(storage, notifier: notifier)
    self.cache = Cache::AutoWire.new(cache, notifier: notifier)
  end

  def required
    i[cache storage notifier]
  end

  def defaults
    {
      listeners: [Events::LogListener.new]
    }
  end
end