Class: ApiValve::Router::Route

Inherits:
Struct
  • Object
show all
Defined in:
lib/api_valve/router.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blockObject

Returns the value of attribute block

Returns:

  • (Object)

    the current value of block



5
6
7
# File 'lib/api_valve/router.rb', line 5

def block
  @block
end

#regexpObject

Returns the value of attribute regexp

Returns:

  • (Object)

    the current value of regexp



5
6
7
# File 'lib/api_valve/router.rb', line 5

def regexp
  @regexp
end

Instance Method Details

#match(path_info) ⇒ Object



8
9
10
11
12
# File 'lib/api_valve/router.rb', line 8

def match(path_info)
  return {} if regexp.nil? # return empty 'match data' on catch all

  regexp.match(path_info)
end