mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Ruby: Document getACapture
This commit is contained in:
committed by
Harry Maclean
parent
870c6d7412
commit
751d8a7f59
@@ -161,6 +161,16 @@ module ActionDispatch {
|
||||
result = call.getKeywordArgument("module").getValueText()
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a URL capture. This is a wildcard URL segment whose value is placed in `params`.
|
||||
* For example, in
|
||||
* ```ruby
|
||||
* get "/foo/:bar/baz", to: "users#index"
|
||||
* ```
|
||||
* the capture is `:bar`.
|
||||
* We don't currently make use of this, but it may be useful in future to more accurately
|
||||
* model the contents of the `params` hash.
|
||||
*/
|
||||
string getACapture() { result = getPathComponent().regexpFind(":[^:/]+", _, _) }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user