@@ -27,10 +27,7 @@ module Bottle {
27
27
*/
28
28
module App {
29
29
/** Gets a reference to a Bottle application (an instance of `bottle.Bottle`) */
30
- API:: Node instance ( ) { result = bottle ( ) .getMember ( "Bottle" ) .getReturn ( ) }
31
-
32
- /** Gets a reference to a Bottle application (an instance of `bottle.app`) */
33
- API:: Node app ( ) { result = bottle ( ) .getMember ( "app" ) .getReturn ( ) }
30
+ API:: Node app ( ) { result = bottle ( ) .getMember ( [ "Bottle" , "app" ] ) .getReturn ( ) }
34
31
}
35
32
36
33
/** Provides models for functions that are possible "views" */
@@ -42,13 +39,13 @@ module Bottle {
42
39
ViewCallable ( ) { this = any ( BottleRouteSetup rs ) .getARequestHandler ( ) }
43
40
}
44
41
42
+ /** Get methods that reprsent a route in Bottle */
45
43
string routeMethods ( ) { result = [ "route" , "get" , "post" , "put" , "delete" , "patch" ] }
46
44
47
45
private class BottleRouteSetup extends Http:: Server:: RouteSetup:: Range , DataFlow:: CallCfgNode {
48
46
BottleRouteSetup ( ) {
49
47
this =
50
48
[
51
- App:: instance ( ) .getMember ( routeMethods ( ) ) .getACall ( ) ,
52
49
App:: app ( ) .getMember ( routeMethods ( ) ) .getACall ( ) ,
53
50
bottle ( ) .getMember ( routeMethods ( ) ) .getACall ( )
54
51
]
@@ -68,8 +65,10 @@ module Bottle {
68
65
69
66
/** Provides models for the `bottle.response` module */
70
67
module Response {
71
- /** Gets a reference to the `bottle.response` module. */
72
- API:: Node response ( ) { result = bottle ( ) .getMember ( "response" ) }
68
+ /** Gets a reference to the `bottle.response` module or instantiation of Bottle Response class. */
69
+ API:: Node response ( ) {
70
+ result = [ bottle ( ) .getMember ( "response" ) , bottle ( ) .getMember ( "Response" ) .getReturn ( ) ]
71
+ }
73
72
74
73
/** A response returned by a view callable. */
75
74
class BottleReturnResponse extends Http:: Server:: HttpResponse:: Range {
0 commit comments