Class: ActiveRubinstein::JosekiQuery
- Defined in:
- lib/active_rubinstein/joseki_query.rb
Overview
Picks a server from the server pool and opens up the interface for queries.
Class Method Summary collapse
-
.execute(query, options = {}) ⇒ Object
analyzes the query to find the correct method to execute.
-
.server ⇒ Object
returns the server object.
Instance Method Summary collapse
-
#initialize ⇒ JosekiQuery
constructor
A new instance of JosekiQuery.
Methods inherited from Base
#hello, #roll, set_language, #shuffle
Constructor Details
#initialize ⇒ JosekiQuery
Returns a new instance of JosekiQuery.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/active_rubinstein/joseki_query.rb', line 40 def initialize server = $serverPool[ :joseki ].first @@log.debug $serverPool[ :joseki ].inspect if server.nil? @@log.error $!. else @@joseki = server @@log.rubinstein "@@joseki = #{server.inspect}" end end |
Class Method Details
.execute(query, options = {}) ⇒ Object
analyzes the query to find the correct method to execute
56 57 58 59 60 |
# File 'lib/active_rubinstein/joseki_query.rb', line 56 def execute( query, ={} ) # construct common SPARQL query = ActiveRubinstein::SparqlFormulator.construct( query, ) results = self.query( query, ) if query end |
.server ⇒ Object
returns the server object
63 64 65 |
# File 'lib/active_rubinstein/joseki_query.rb', line 63 def server @@joseki end |