Class: MoonropeClient::Request
- Inherits:
-
Object
- Object
- MoonropeClient::Request
- Defined in:
- lib/moonrope_client/request.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(connection, controller, action, params = {}) ⇒ Request
constructor
Initialize a new request.
- #make ⇒ Object
- #make! ⇒ Object
Constructor Details
#initialize(connection, controller, action, params = {}) ⇒ Request
Initialize a new request
14 15 16 17 18 19 |
# File 'lib/moonrope_client/request.rb', line 14 def initialize(connection, controller, action, params = {}) @connection = connection @controller = controller.to_sym @action = action.to_sym @params = params end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
21 22 23 |
# File 'lib/moonrope_client/request.rb', line 21 def params @params end |
Instance Method Details
#make ⇒ Object
23 24 25 |
# File 'lib/moonrope_client/request.rb', line 23 def make raw_data_to_response_object(make_request) end |
#make! ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/moonrope_client/request.rb', line 27 def make! result = raw_data_to_response_object(make_request) if result.success? result else raise MoonropeClient::RequestError.new(result), "Request was not successful. Got #{result.class} (#{result.})." end end |