Class: Rack::Offline::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/offline/config.rb

Instance Method Summary collapse

Constructor Details

#initialize(root, &block) ⇒ Config

Returns a new instance of Config.



4
5
6
7
8
9
10
# File 'lib/rack/offline/config.rb', line 4

def initialize(root, &block)
  @cache = []
  @network = []
  @fallback = {}
  @root = root
  instance_eval(&block) if block_given?
end

Instance Method Details

#cache(*names) ⇒ Object



12
13
14
# File 'lib/rack/offline/config.rb', line 12

def cache(*names)
  @cache.concat(names)
end

#fallback(hash = {}) ⇒ Object



20
21
22
# File 'lib/rack/offline/config.rb', line 20

def fallback(hash = {})
  @fallback.merge!(hash)
end

#network(*names) ⇒ Object



16
17
18
# File 'lib/rack/offline/config.rb', line 16

def network(*names)
  @network.concat(names)
end

#rootObject



24
25
26
# File 'lib/rack/offline/config.rb', line 24

def root
  @root
end