Class: VatInfo::Models::Status
- Inherits:
-
Object
- Object
- VatInfo::Models::Status
- Defined in:
- lib/vat_info/models/status.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
- #create_status ⇒ Object
-
#initialize(params = {}) ⇒ Status
constructor
A new instance of Status.
Constructor Details
#initialize(params = {}) ⇒ Status
6 7 8 9 10 |
# File 'lib/vat_info/models/status.rb', line 6 def initialize(params = {}) @params = params @data = {} @data[:status] = create_status end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
4 5 6 |
# File 'lib/vat_info/models/status.rb', line 4 def data @data end |
#params ⇒ Object
Returns the value of attribute params.
4 5 6 |
# File 'lib/vat_info/models/status.rb', line 4 def params @params end |
Instance Method Details
#create_status ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/vat_info/models/status.rb', line 12 def create_status { status_code: params.fetch(:@status_code), status_text: params.fetch(:@status_text), odpoved_generovana: params.fetch(:@odpoved_generovana) } rescue KeyError => e raise InvalidStructure, "Response XML is missing required attributes.\n" \ "Input params were: #{params}\n" \ "Rescued error: #{e}" end |