Class: HttpRouter::Route

Inherits:
Object
  • Object
show all
Defined in:
lib/http_router/route.rb

Constant Summary collapse

VALID_HTTP_VERBS =
%w{GET POST PUT DELETE HEAD OPTIONS TRACE}

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#default_valuesObject (readonly)

Returns the value of attribute default_values.



7
8
9
# File 'lib/http_router/route.rb', line 7

def default_values
  @default_values
end

#destObject

Returns the value of attribute dest.



8
9
10
# File 'lib/http_router/route.rb', line 8

def dest
  @dest
end

#generatorObject

Returns the value of attribute generator.



8
9
10
# File 'lib/http_router/route.rb', line 8

def generator
  @generator
end

#hostObject

Returns the value of attribute host.



8
9
10
# File 'lib/http_router/route.rb', line 8

def host
  @host
end

#ignore_trailing_slashObject

Returns the value of attribute ignore_trailing_slash.



8
9
10
# File 'lib/http_router/route.rb', line 8

def ignore_trailing_slash
  @ignore_trailing_slash
end

#match_partiallyObject

Returns the value of attribute match_partially.



7
8
9
# File 'lib/http_router/route.rb', line 7

def match_partially
  @match_partially
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/http_router/route.rb', line 7

def name
  @name
end

#original_pathObject

Returns the value of attribute original_path.



8
9
10
# File 'lib/http_router/route.rb', line 8

def original_path
  @original_path
end

#other_hostsObject (readonly)

Returns the value of attribute other_hosts.



7
8
9
# File 'lib/http_router/route.rb', line 7

def other_hosts
  @other_hosts
end

#path_for_generationObject

Returns the value of attribute path_for_generation.



8
9
10
# File 'lib/http_router/route.rb', line 8

def path_for_generation
  @path_for_generation
end

#path_validation_regexObject

Returns the value of attribute path_validation_regex.



8
9
10
# File 'lib/http_router/route.rb', line 8

def path_validation_regex
  @path_validation_regex
end

#pathsObject (readonly)

Returns the value of attribute paths.



7
8
9
# File 'lib/http_router/route.rb', line 7

def paths
  @paths
end

#request_methodsObject (readonly)

Returns the value of attribute request_methods.



7
8
9
# File 'lib/http_router/route.rb', line 7

def request_methods
  @request_methods
end

#routerObject

Returns the value of attribute router.



7
8
9
# File 'lib/http_router/route.rb', line 7

def router
  @router
end

#schemeObject

Returns the value of attribute scheme.



8
9
10
# File 'lib/http_router/route.rb', line 8

def scheme
  @scheme
end

#user_agentObject

Returns the value of attribute user_agent.



8
9
10
# File 'lib/http_router/route.rb', line 8

def user_agent
  @user_agent
end

Instance Method Details

#create_clone(new_router) ⇒ Object



11
12
13
14
15
# File 'lib/http_router/route.rb', line 11

def create_clone(new_router)
  r = clone
  r.dest = (begin; dest.clone; rescue; dest; end)
  r
end

#matches_with(var_name) ⇒ Object



21
22
23
# File 'lib/http_router/route.rb', line 21

def matches_with(var_name)
  @match_with && @match_with[:"#{var_name}"]
end

#to_sObject



17
18
19
# File 'lib/http_router/route.rb', line 17

def to_s
  "#<HttpRouter:Route #{object_id} @path_for_generation=#{path_for_generation.inspect}>"
end