Class: ModulePos::Fiscalization::Client::Scopes::Docs
- Defined in:
- lib/module_pos/fiscalization/client.rb
Overview
Docs actions scope
Instance Method Summary collapse
- #re_queue(id) ⇒ ModulePos::Fiscalization::Entities::DocStatus
-
#save(doc) ⇒ ModulePos::Fiscalization::Entities::DocStatus
Send doc to modulpose.
- #status(id) ⇒ ModulePos::Fiscalization::Entities::DocStatus
Methods inherited from Base
Constructor Details
This class inherits a constructor from ModulePos::Fiscalization::Client::Scopes::Base
Instance Method Details
#re_queue(id) ⇒ ModulePos::Fiscalization::Entities::DocStatus
77 78 79 80 81 82 83 |
# File 'lib/module_pos/fiscalization/client.rb', line 77 def re_queue(id) resp = http.call(username, pass) do |conn| conn.put("#{path}/#{id}/re-queue") end ModulePos::Fiscalization::Entities::DocStatus.new(resp) end |
#save(doc) ⇒ ModulePos::Fiscalization::Entities::DocStatus
Send doc to modulpose
55 56 57 58 59 60 61 62 63 |
# File 'lib/module_pos/fiscalization/client.rb', line 55 def save(doc) resp = http.call(username, pass) do |conn| conn.post(CREATE_DOC_PATH) do |req| req.body = doc.to_json end end ModulePos::Fiscalization::Entities::DocStatus.new(resp) end |
#status(id) ⇒ ModulePos::Fiscalization::Entities::DocStatus
67 68 69 70 71 72 73 |
# File 'lib/module_pos/fiscalization/client.rb', line 67 def status(id) resp = http.call(username, pass) do |conn| conn.get("#{path}/#{id}/status") end ModulePos::Fiscalization::Entities::DocStatus.new(resp) end |