Class: Howl::Padrino::Route

Inherits:
Route
  • Object
show all
Defined in:
lib/howl-router/padrino/route.rb

Instance Attribute Summary collapse

Attributes inherited from Route

#block, #capture, #default_values, #name, #order, #router, #verb

Instance Method Summary collapse

Methods inherited from Route

#arity, #initialize, #matcher, #path, #to

Constructor Details

This class inherits a constructor from Howl::Route

Instance Attribute Details

#actionObject

Returns the value of attribute action.



6
7
8
# File 'lib/howl-router/padrino/route.rb', line 6

def action
  @action
end

#cacheObject

Returns the value of attribute cache.



6
7
8
# File 'lib/howl-router/padrino/route.rb', line 6

def cache
  @cache
end

#cache_expires_inObject

Returns the value of attribute cache_expires_in.



6
7
8
# File 'lib/howl-router/padrino/route.rb', line 6

def cache_expires_in
  @cache_expires_in
end

#cache_keyObject

Returns the value of attribute cache_key.



6
7
8
# File 'lib/howl-router/padrino/route.rb', line 6

def cache_key
  @cache_key
end

#controllerObject

Returns the value of attribute controller.



6
7
8
# File 'lib/howl-router/padrino/route.rb', line 6

def controller
  @controller
end

#parentObject

Returns the value of attribute parent.



6
7
8
# File 'lib/howl-router/padrino/route.rb', line 6

def parent
  @parent
end

#path_for_generationObject

Returns the value of attribute path_for_generation.



6
7
8
# File 'lib/howl-router/padrino/route.rb', line 6

def path_for_generation
  @path_for_generation
end

#use_layoutObject

Returns the value of attribute use_layout.



6
7
8
# File 'lib/howl-router/padrino/route.rb', line 6

def use_layout
  @use_layout
end

#user_agentObject

Returns the value of attribute user_agent.



6
7
8
# File 'lib/howl-router/padrino/route.rb', line 6

def user_agent
  @user_agent
end

Instance Method Details

#after_filters(&block) ⇒ Object



15
16
17
18
19
# File 'lib/howl-router/padrino/route.rb', line 15

def after_filters(&block)
  @_after_filters ||= []
  @_after_filters << block if block_given?
  @_after_filters
end

#before_filters(&block) ⇒ Object



9
10
11
12
13
# File 'lib/howl-router/padrino/route.rb', line 9

def before_filters(&block)
  @_before_filters ||= []
  @_before_filters << block if block_given?
  @_before_filters
end

#call(app, *args) ⇒ Object



27
28
29
# File 'lib/howl-router/padrino/route.rb', line 27

def call(app, *args)
  @block.call(app, *args)
end

#custom_conditions(&block) ⇒ Object



21
22
23
24
25
# File 'lib/howl-router/padrino/route.rb', line 21

def custom_conditions(&block)
  @_custom_conditions ||= []
  @_custom_conditions << block if block_given?
  @_custom_conditions
end

#original_pathObject



35
36
37
# File 'lib/howl-router/padrino/route.rb', line 35

def original_path 
  @path 
end

#request_methodsObject



31
32
33
# File 'lib/howl-router/padrino/route.rb', line 31

def request_methods
  [verb.to_s.upcase]
end

#significant_variable_namesObject



39
40
41
42
43
44
45
46
47
# File 'lib/howl-router/padrino/route.rb', line 39

def significant_variable_names
  @significant_variable_names ||= if @path.is_a?(String)
    @path.scan(/(^|[^\\])[:\*]([a-zA-Z0-9_]+)/).map{|p| p.last.to_sym}
  elsif @path.is_a?(Regexp) and @path.respond_to?(:named_captures)
    @path.named_captures.keys.map(&:to_sym)
  else
    []
  end
end