Class: Laximo::Respond::Base
- Inherits:
-
Object
- Object
- Laximo::Respond::Base
- Defined in:
- lib/laximo/respond.rb
Direct Known Subclasses
ExecCustomOperation, FindDetail, FindOem, FindOemCorrection, FindReplacements, FindVehicle, FindVehicleByFrame, FindVehicleByFrameNo, FindVehicleByVin, FindVehicleByWizard2, GetCatalogInfo, GetFilterByDetail, GetFilterByUnit, GetUnitInfo, GetVehicleInfo, GetWizard2, GetWizardNextStep2, ListCatalogs, ListCategories, ListDetailByUnit, ListImageMapByUnit, ListManufacturer, ListQuickDetail, ListQuickGroup, ListUnits, Manufacturer_Info
Constant Summary collapse
- RESPONSE_RESULT =
'//QueryDataResponse/return'.freeze
- RESPONSE_LOGIN_RESULT =
'//QueryDataLoginResponse/return'.freeze
- RESPONSE_SOAP_ERROR =
'//Fault/faultstring'.freeze
Instance Method Summary collapse
- #error ⇒ Object
-
#failure? ⇒ Boolean
(also: #error?)
success?.
-
#initialize(request) ⇒ Base
constructor
A new instance of Base.
-
#parsing_result(str) ⇒ Object
result!.
-
#result ⇒ Object
error.
-
#result! ⇒ Object
result.
-
#success? ⇒ Boolean
initialize.
Constructor Details
#initialize(request) ⇒ Base
Returns a new instance of Base.
12 13 14 15 16 17 18 19 |
# File 'lib/laximo/respond.rb', line 12 def initialize(request) @error = nil @result = [] prepare_request(request) end |
Instance Method Details
#error ⇒ Object
31 32 33 |
# File 'lib/laximo/respond.rb', line 31 def error @error end |
#failure? ⇒ Boolean Also known as: error?
success?
25 26 27 |
# File 'lib/laximo/respond.rb', line 25 def failure? !@error.nil? end |
#parsing_result(str) ⇒ Object
result!
46 47 48 |
# File 'lib/laximo/respond.rb', line 46 def parsing_result(str) ::NotImplementedError.new("Метод `parsing_result` не реализован в классе #{self.class.name}") end |
#result ⇒ Object
error
35 36 37 |
# File 'lib/laximo/respond.rb', line 35 def result @result end |
#result! ⇒ Object
result
39 40 41 42 43 44 |
# File 'lib/laximo/respond.rb', line 39 def result! raise error.class, error. if failure? result end |
#success? ⇒ Boolean
initialize
21 22 23 |
# File 'lib/laximo/respond.rb', line 21 def success? @error.nil? end |