Class: Fiscalizer::Deserializers::Base
- Inherits:
-
Object
- Object
- Fiscalizer::Deserializers::Base
show all
- Includes:
- Constants
- Defined in:
- lib/fiscalizer/deserializers/base.rb
Constant Summary
Constants included
from Constants
Constants::DEMO_CERT_ISSUER, Constants::DEMO_URL, Constants::PROD_CERT_ISSUER, Constants::PROD_URL, Constants::SCHEMA_LOCATION, Constants::TNS, Constants::XSI
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(raw_response, object) ⇒ Base
6
7
8
9
|
# File 'lib/fiscalizer/deserializers/base.rb', line 6
def initialize(raw_response, object)
@raw_response = raw_response
@object = object
end
|
Instance Attribute Details
#object ⇒ Object
Returns the value of attribute object.
11
12
13
|
# File 'lib/fiscalizer/deserializers/base.rb', line 11
def object
@object
end
|
#raw_response ⇒ Object
Returns the value of attribute raw_response.
11
12
13
|
# File 'lib/fiscalizer/deserializers/base.rb', line 11
def raw_response
@raw_response
end
|
Instance Method Details
#errors ⇒ Object
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/fiscalizer/deserializers/base.rb', line 25
def errors
@errors ||= begin
error_nodes.map do |error_node|
{
code: element_value(error_node, 'SifraGreske'),
message: element_value(error_node, 'PorukaGreske')
}
end
end
end
|
#errors? ⇒ Boolean
21
22
23
|
# File 'lib/fiscalizer/deserializers/base.rb', line 21
def errors?
error_nodes.any?
end
|
#processed_at ⇒ Object
17
18
19
|
# File 'lib/fiscalizer/deserializers/base.rb', line 17
def processed_at
element_value(root, 'DatumVrijeme')
end
|
#uuid ⇒ Object
13
14
15
|
# File 'lib/fiscalizer/deserializers/base.rb', line 13
def uuid
element_value(root, 'IdPoruke')
end
|