lib/atol/transaction/get_document_state.rb in atol-0.3 vs lib/atol/transaction/get_document_state.rb in atol-0.4

- old
+ new

@@ -5,15 +5,15 @@ module Transaction class GetDocumentState def initialize(uuid:, token:, config: nil) @config = config || Atol.config raise(Atol::ConfigExpectedError) unless @config.is_a?(Atol::Config) - @params = Hash[uuid: uuid, token: token, config: @config] + @params = { uuid: uuid, token: token, config: @config } end def call - request = Atol::Request::GetDocumentState.new(params) + request = Atol::Request::GetDocumentState.new(@params) response = request.call encoded_body = response.body.force_encoding(Atol::ENCODING) json = JSON.parse(encoded_body) if response.code == '200' && json['error'].nil? @@ -22,12 +22,8 @@ raise(Atol::ERRORS[json['error']['code']], encoded_body) else raise(encoded_body) end end - - private - - attr_reader :params end end end