Class: Dirble::QueryExecuter
- Inherits:
-
Object
- Object
- Dirble::QueryExecuter
- Defined in:
- lib/dirble/query_executer.rb
Constant Summary collapse
- REQUEST_TYPES =
[:get, :post, :put, :delete, :patch]
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(connection, query_params) ⇒ QueryExecuter
constructor
A new instance of QueryExecuter.
Constructor Details
#initialize(connection, query_params) ⇒ QueryExecuter
Returns a new instance of QueryExecuter.
5 6 7 8 9 10 |
# File 'lib/dirble/query_executer.rb', line 5 def initialize(connection, query_params) self.connection = connection self.request_type = query_params[:request_type] self.query = query_params[:query] self.form_fields = query_params[:form_fields] end |
Instance Method Details
#execute ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/dirble/query_executer.rb', line 12 def execute guard_query_params replace_placeholder_with_api_key if form_fields connection.send(request_type, query, form_fields) else connection.send(request_type, query) end end |