Class: ApiValve::RouteSet::Route

Inherits:
Struct
  • Object
show all
Defined in:
lib/api_valve/route_set.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/route_set.rb', line 5

def block
  @block
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



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

def options
  @options
end

#regexpObject

Returns the value of attribute regexp

Returns:

  • (Object)

    the current value of regexp



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

def regexp
  @regexp
end

Instance Method Details

#match(path_info) ⇒ Object



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

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

  regexp.match(path_info)
end