pina 0.12.3 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +29 -0
- data/lib/pina.rb +1 -0
- data/lib/pina/collections/stat_processed_document.rb +7 -0
- data/lib/pina/models/stat_processed_document.rb +25 -0
- data/lib/pina/stat_processed_document.rb +45 -0
- data/lib/pina/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12e1b8434afd19e87694e2ddccea223d43718d22
|
4
|
+
data.tar.gz: 54c5df65e806713cc4ca63e05438c1b5aa4e5030
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ab21f7557e14a9e6a09dfc5d85483f2394d815e73c63096998dce35c9fa31b373a5b8038ade5e3cabdf5af7bba8b8028128a3de182960303f9b63383dbbbb6f
|
7
|
+
data.tar.gz: 3be306b670e6f25b815a0ac82d4d717ddb835d0494635f9903d9469c86b89f3904b24b00682916ad23c96a8ab08b84dc210ebd9ae89dfb97d3c15a7c35550117
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6
6
|
|
7
|
+
## [0.13.0] - 2017-10-19
|
8
|
+
### Changed
|
9
|
+
|
10
|
+
### Added
|
11
|
+
- StatProcessedDocument api wrapper
|
12
|
+
|
13
|
+
### Fixed
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
7
18
|
## [0.11.0] - 2017-03-10
|
8
19
|
### Changed
|
9
20
|
- Typhoeus removed in favour of Net::HTTP
|
data/README.md
CHANGED
@@ -220,6 +220,35 @@ Pina::ProcessedDocument.find(gid)
|
|
220
220
|
Pina::ProcessedDocument.delete(gid)
|
221
221
|
```
|
222
222
|
|
223
|
+
### Stat Processed Documents
|
224
|
+
|
225
|
+
#### All stat processed documents
|
226
|
+
|
227
|
+
```ruby
|
228
|
+
Pina::StatProcessedDocument.all
|
229
|
+
```
|
230
|
+
|
231
|
+
Gets all stat processed documents from your database. Results are paginated and you can access
|
232
|
+
first, next or previous page like this:
|
233
|
+
|
234
|
+
```ruby
|
235
|
+
stats = Pina::StatProcessedDocument.all
|
236
|
+
stats.next_page
|
237
|
+
```
|
238
|
+
|
239
|
+
```ruby
|
240
|
+
stats = Pina::StatProcessedDocument.all
|
241
|
+
stats.previous_page
|
242
|
+
|
243
|
+
stats.first_page
|
244
|
+
```
|
245
|
+
|
246
|
+
#### Fetching specific stat processed document
|
247
|
+
|
248
|
+
```ruby
|
249
|
+
Pina::StatProcessedDocument.find(gid)
|
250
|
+
```
|
251
|
+
|
223
252
|
### MyBankAccounts
|
224
253
|
|
225
254
|
#### All my bank accoutns
|
data/lib/pina.rb
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
module Pina
|
2
|
+
module Models
|
3
|
+
class StatProcessedDocument
|
4
|
+
include Virtus.model
|
5
|
+
|
6
|
+
attribute :gid
|
7
|
+
attribute :cuser
|
8
|
+
attribute :ctime
|
9
|
+
attribute :muser
|
10
|
+
attribute :mtime
|
11
|
+
attribute :isvalid
|
12
|
+
attribute :islocked
|
13
|
+
attribute :external_id
|
14
|
+
attribute :status
|
15
|
+
attribute :manually_processed
|
16
|
+
attribute :table
|
17
|
+
attribute :date
|
18
|
+
attribute :user
|
19
|
+
attribute :type
|
20
|
+
attribute :count
|
21
|
+
attribute :min
|
22
|
+
attribute :max
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'pina/models/stat_processed_document'
|
2
|
+
require 'pina/collections/stat_processed_document'
|
3
|
+
|
4
|
+
module Pina
|
5
|
+
class StatProcessedDocument
|
6
|
+
class << self
|
7
|
+
def new(params = nil)
|
8
|
+
Pina::Models::StatProcessedDocument.new(params)
|
9
|
+
end
|
10
|
+
|
11
|
+
def find(id)
|
12
|
+
response = Pina::RestAdapter.get(:stat_processed_documents, id)
|
13
|
+
|
14
|
+
return Pina::Models::StatProcessedDocument.new(attributes(response)) if
|
15
|
+
response.ok?
|
16
|
+
|
17
|
+
response
|
18
|
+
end
|
19
|
+
|
20
|
+
def where(hash, page = nil)
|
21
|
+
response = Pina::RestAdapter.get(:stat_processed_documents, hash)
|
22
|
+
|
23
|
+
return Pina::Collections::StatProcessedDocument.new(attributes(response)) if
|
24
|
+
response.ok?
|
25
|
+
|
26
|
+
response
|
27
|
+
end
|
28
|
+
|
29
|
+
def all(page = nil)
|
30
|
+
response = Pina::RestAdapter.get(:stat_processed_documents, page)
|
31
|
+
|
32
|
+
return Pina::Collections::StatProcessedDocument.new(attributes(response)) if
|
33
|
+
response.ok?
|
34
|
+
|
35
|
+
response
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def attributes(response)
|
41
|
+
response.to_hash.merge(response: response)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/lib/pina/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pina
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Hronek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -219,6 +219,7 @@ files:
|
|
219
219
|
- lib/pina/collections/receivable.rb
|
220
220
|
- lib/pina/collections/sales_invoice.rb
|
221
221
|
- lib/pina/collections/sales_order.rb
|
222
|
+
- lib/pina/collections/stat_processed_document.rb
|
222
223
|
- lib/pina/collections/uploaded_document.rb
|
223
224
|
- lib/pina/contact.rb
|
224
225
|
- lib/pina/models/address.rb
|
@@ -229,6 +230,7 @@ files:
|
|
229
230
|
- lib/pina/models/sales_invoice.rb
|
230
231
|
- lib/pina/models/sales_item.rb
|
231
232
|
- lib/pina/models/sales_order.rb
|
233
|
+
- lib/pina/models/stat_processed_document.rb
|
232
234
|
- lib/pina/models/uploaded_document.rb
|
233
235
|
- lib/pina/my_bank_account.rb
|
234
236
|
- lib/pina/processed_document.rb
|
@@ -236,6 +238,7 @@ files:
|
|
236
238
|
- lib/pina/rest_adapter.rb
|
237
239
|
- lib/pina/sales_invoice.rb
|
238
240
|
- lib/pina/sales_order.rb
|
241
|
+
- lib/pina/stat_processed_document.rb
|
239
242
|
- lib/pina/uploaded_document.rb
|
240
243
|
- lib/pina/utils/pagination.rb
|
241
244
|
- lib/pina/version.rb
|