Class: RSimpy::QueryingService
- Inherits:
-
BaseService
- Object
- BaseService
- RSimpy::QueryingService
- Defined in:
- lib/querying_service.rb
Instance Attribute Summary
Attributes inherited from BaseService
#status_code, #status_message, #success
Instance Method Summary collapse
- #build_link(params) ⇒ Object
- #execute(params) ⇒ Object
-
#initialize(command, client) ⇒ QueryingService
constructor
A new instance of QueryingService.
Methods inherited from BaseService
#execute_using, #reset, #set_status
Constructor Details
#initialize(command, client) ⇒ QueryingService
Returns a new instance of QueryingService.
10 11 12 13 |
# File 'lib/querying_service.rb', line 10 def initialize command, client @client = client @command = command end |
Instance Method Details
#build_link(params) ⇒ Object
26 27 28 29 |
# File 'lib/querying_service.rb', line 26 def build_link params params.add(:src, 'rsimpy') "/#{@command}.do?" << params.to_querystring end |
#execute(params) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/querying_service.rb', line 15 def execute params params = RSimpy::Parameters.new unless params reset response = @client.get build_link params @success = (response.code == 200) response end |