Class: Jeanine::PathProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/jeanine/path_proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(context, pathname, options = {}) ⇒ PathProxy

Returns a new instance of PathProxy.



3
4
5
6
7
# File 'lib/jeanine/path_proxy.rb', line 3

def initialize(context, pathname, options = {})
  @context = context
  @pathname = pathname
  @options = options
end

Instance Method Details

#after(*paths, &block) ⇒ Object



63
64
65
# File 'lib/jeanine/path_proxy.rb', line 63

def after(*paths, &block)
  @context.after(*paths, &block)
end

#before(*paths, &block) ⇒ Object



59
60
61
# File 'lib/jeanine/path_proxy.rb', line 59

def before(*paths, &block)
  @context.before(*paths, &block)
end

#delete(path = nil, options = {}, &block) ⇒ Object



39
40
41
42
# File 'lib/jeanine/path_proxy.rb', line 39

def delete(path = nil, options = {}, &block)
  @options.reverse_merge!(options)
  @context.delete(merged_path(path), options, &block)
end

#get(path = nil, options = {}, &block) ⇒ Object



9
10
11
12
# File 'lib/jeanine/path_proxy.rb', line 9

def get(path = nil, options = {}, &block)
  @options.reverse_merge!(options)
  @context.get(merged_path(path), options, &block)
end

#head(path = nil, options = {}, &block) ⇒ Object



34
35
36
37
# File 'lib/jeanine/path_proxy.rb', line 34

def head(path = nil, options = {}, &block)
  @options.reverse_merge!(options)
  @context.head(merged_path(path), options, &block)
end

#match(path = nil, options = {}, &block) ⇒ Object



49
50
51
52
# File 'lib/jeanine/path_proxy.rb', line 49

def match(path = nil, options = {}, &block)
  @options.reverse_merge!(options)
  @context.match(merged_path(path), options, &block)
end

#options(path = nil, options = {}, &block) ⇒ Object



29
30
31
32
# File 'lib/jeanine/path_proxy.rb', line 29

def options(path = nil, options = {}, &block)
  @options.reverse_merge!(options)
  @context.options(merged_path(path), options, &block)
end

#patch(path = nil, options = {}, &block) ⇒ Object



19
20
21
22
# File 'lib/jeanine/path_proxy.rb', line 19

def patch(path = nil, options = {}, &block)
  @options.reverse_merge!(options)
  @context.patch(merged_path(path), options, &block)
end

#path(path = nil, options = {}, &block) ⇒ Object



44
45
46
47
# File 'lib/jeanine/path_proxy.rb', line 44

def path(path = nil, options = {}, &block)
  @options.reverse_merge!(options)
  @context.path(merged_path(path), options, &block)
end

#post(path = nil, options = {}, &block) ⇒ Object



14
15
16
17
# File 'lib/jeanine/path_proxy.rb', line 14

def post(path = nil, options = {}, &block)
  @options.reverse_merge!(options)
  @context.post(merged_path(path), options, &block)
end

#put(path = nil, options = {}, &block) ⇒ Object



24
25
26
27
# File 'lib/jeanine/path_proxy.rb', line 24

def put(path = nil, options = {}, &block)
  @options.reverse_merge!(options)
  @context.put(merged_path(path), options, &block)
end

#root(path = '/', options = {}, &block) ⇒ Object



54
55
56
57
# File 'lib/jeanine/path_proxy.rb', line 54

def root(path = '/', options = {}, &block)
  @options.reverse_merge!(options)
  @context.root(merged_path(path), options, &block)
end