Class: Einvoice::Tradevan::Result
- Inherits:
-
Result
- Object
- Result
- Einvoice::Tradevan::Result
show all
- Defined in:
- lib/einvoice/tradevan/result.rb
Instance Attribute Summary
Attributes inherited from Result
#response
Instance Method Summary
collapse
Methods inherited from Result
#initialize
Instance Method Details
#data ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/einvoice/tradevan/result.rb', line 16
def data
if response.is_a? ActiveModel::Errors
nil
else
response && response["Message"]
end
end
|
#errors ⇒ Object
4
5
6
7
8
9
10
|
# File 'lib/einvoice/tradevan/result.rb', line 4
def errors
if response.is_a? ActiveModel::Errors
response.full_messages.join('; ')
else
response && response["Message"]
end
end
|
#successful? ⇒ Boolean
12
13
14
|
# File 'lib/einvoice/tradevan/result.rb', line 12
def successful?
response && !response.is_a?(ActiveModel::Errors) && response["Success"] == 'Y'
end
|