Module: Alf::Rack::Helpers
- Included in:
- Query
- Defined in:
- lib/alf/rack/helpers.rb
Instance Method Summary collapse
-
#alf_config ⇒ Object
Returns Alf configuration previously installed by the Connect middleware.
-
#alf_connection ⇒ Object
Returns Alf’s connection previously installed by the Connect middleware.
-
#query(*args, &bl) ⇒ Object
Executes a query on the connection and returns the result.
-
#relvar(*args, &bl) ⇒ Object
Requests a relvar on the connection and returns it.
-
#tuple_extract(*args, &bl) ⇒ Object
Requests a tuple on the connection and returns it.
Instance Method Details
#alf_config ⇒ Object
Returns Alf configuration previously installed by the Connect middleware
7 8 9 |
# File 'lib/alf/rack/helpers.rb', line 7 def alf_config env[Alf::Rack::Connect::CONFIG_KEY] end |
#alf_connection ⇒ Object
Returns Alf’s connection previously installed by the Connect middleware
13 14 15 |
# File 'lib/alf/rack/helpers.rb', line 13 def alf_connection alf_config.connection end |
#query(*args, &bl) ⇒ Object
Executes a query on the connection and returns the result.
18 19 20 |
# File 'lib/alf/rack/helpers.rb', line 18 def query(*args, &bl) alf_connection.query(*args, &bl) end |
#relvar(*args, &bl) ⇒ Object
Requests a relvar on the connection and returns it.
23 24 25 |
# File 'lib/alf/rack/helpers.rb', line 23 def relvar(*args, &bl) alf_connection.relvar(*args, &bl) end |
#tuple_extract(*args, &bl) ⇒ Object
Requests a tuple on the connection and returns it.
28 29 30 |
# File 'lib/alf/rack/helpers.rb', line 28 def tuple_extract(*args, &bl) alf_connection.tuple_extract(*args, &bl) end |