quaderno 1.7.3 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ce3b824827732c0cf058860e1214ae0b4ffb731
4
- data.tar.gz: aa1b3180548004212bce574d2e00d15e4e79c15c
3
+ metadata.gz: 423898afe9290b9d5a056ed17c7e0ec2cb50e777
4
+ data.tar.gz: 7617314a3d1c18d9db47729030b8232f4de2011b
5
5
  SHA512:
6
- metadata.gz: 2d06bfee33d9ee87a0dac839a20187e022567d1ee5df572e40adcb66e1672099d80f3ba659e61f05987ec0e6efb5dad988227b6fa20052a24e0f92fa46f773f8
7
- data.tar.gz: 9664ede64110b77aa953e6fda25edab0ed78639a4795f9341e6633970c97a6ee9d25fe05f5da887d9a0db4c2b1fed5a196776d00a00aaaeddbce6ce2ed691d77
6
+ metadata.gz: ed38c65f4f96f9999c85b0b19f9fa9c31ae59db0c3ea2420600acab0f48e4f4a20434fa5a7ac86384ffb612dc4d3f774bbf8d034beb6fad96a82dc561fa25136
7
+ data.tar.gz: 1a9c6a1d1b737c3304bc7a5dbffab9d51c0ff74f8ddc7df571e8ae405566be39c40effdf9798a34279dd6b841c68a0a58926f4855ada5dec8dc2099ce89ea7ab
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Quaderno-ruby is a ruby wrapper for [Quaderno API] (https://github.com/quaderno/quaderno-api).
4
4
  As the API, it's mostly CRUD.
5
5
 
6
- Current version is 1.7.2 See the changelog [here](https://github.com/quaderno/quaderno-ruby/blob/master/changelog.md)
6
+ Current version is 1.8.0 See the changelog [here](https://github.com/quaderno/quaderno-ruby/blob/master/changelog.md)
7
7
 
8
8
  ## Installation & Configuration
9
9
 
@@ -205,13 +205,62 @@ In order to remove a payment you will need the Invoice instance you want to upd
205
205
 
206
206
  ###Delivering the invoice
207
207
 
208
- In order to deliver the estimate to the default recipient you will need the estimate you want to send.
208
+ In order to deliver the invoice to the default recipient you will need the invoice you want to send.
209
209
 
210
210
  ```ruby
211
211
  invoice = Quaderno::Invoice.find(invoice_id)
212
212
  invoice.deliver
213
213
  ```
214
214
 
215
+ ## Managing receipts
216
+
217
+ ### Getting receipts
218
+ ```ruby
219
+ Quaderno::Receipt.all #=> Array
220
+ Quaderno::Receipt.all(page: 1) #=> Array
221
+ ```
222
+
223
+ will return an array with all your receipts on the first page. You can also pass query strings using the attribute :q in order to filter the results by contact name, :state to filter by state or :date to filter by date
224
+
225
+ ### Finding a receipt
226
+ ```ruby
227
+ Quaderno::Receipt.find(id) #=> Quaderno::Receipt
228
+ ```
229
+
230
+ will return the receipt with the id passed as parameter.
231
+
232
+ ### Creating a new receipt
233
+
234
+ ```ruby
235
+ Quaderno::Receipt.create(params) #=> Quaderno::Receipt
236
+ ```
237
+
238
+ will create an receipt using the information of the hash passed as parameter.
239
+
240
+ ### Updating an existing receipt
241
+ ```ruby
242
+ Quaderno::Receipt.update(id, params) #=> Quaderno::Receipt
243
+ ```
244
+
245
+ will update the specified receipt with the data of the hash passed as second parameter.
246
+
247
+ ### Deleting an receipt
248
+
249
+ ```ruby
250
+ Quaderno::Receipt.delete(id) #=> Boolean
251
+ ```
252
+
253
+ will delete the receipt with the id passed as parameter.
254
+
255
+ ###Delivering the receipt
256
+
257
+ In order to deliver the receipt to the default recipient you will need the receipt you want to send.
258
+
259
+ ```ruby
260
+ receipt = Quaderno::Receipt.find(receipt_id)
261
+ receipt.deliver
262
+ ```
263
+
215
264
 
216
265
  ## Managing credits
217
266
 
@@ -273,7 +322,7 @@ In order to remove a payment you will need the Credit instance you want to upda
273
322
 
274
323
  ###Delivering the credit
275
324
 
276
- In order to deliver the estimate to the default recipient you will need the estimate you want to send.
325
+ In order to deliver the credit to the default recipient you will need the credit you want to send.
277
326
 
278
327
  ```ruby
279
328
  credit = Quaderno::Credit.find(credit_id)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.3
1
+ 1.8.0
data/changelog.md CHANGED
@@ -1,6 +1,12 @@
1
1
  #Changelog
2
+
3
+ ##1.8.0
4
+ * Add Quaderno::Receipt support
5
+ * Fix errors in README
6
+
2
7
  ##1.7.3
3
8
  * Raise exception on failed updates
9
+
4
10
  ##1.7.2
5
11
  * Fix URL in Quaderno::Tax.calculate by [**@jcxplorer**] (https://github.com/jcxplorer)
6
12
 
@@ -0,0 +1,9 @@
1
+ module Quaderno
2
+ class Receipt < Base
3
+ include Quaderno::Behavior::Deliver
4
+
5
+ api_model Quaderno::Receipt
6
+ api_path 'receipts'
7
+ is_a_document? true
8
+ end
9
+ end
data/lib/quaderno-ruby.rb CHANGED
@@ -2,7 +2,7 @@ require 'ostruct'
2
2
 
3
3
  require 'quaderno-ruby/exceptions/exceptions'
4
4
  %w(crud deliver payment).each { |filename| require "quaderno-ruby/behavior/#{ filename }" }
5
- %w(base contact item invoice credit estimate expense recurring document_item payment webhook tax).each { |filename| require "quaderno-ruby/#{ filename }" }
5
+ %w(base contact item invoice receipt credit estimate expense recurring document_item payment webhook tax).each { |filename| require "quaderno-ruby/#{ filename }" }
6
6
 
7
7
  module Quaderno
8
8
 
data/quaderno.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: quaderno 1.7.3 ruby lib
5
+ # stub: quaderno 1.8.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "quaderno"
9
- s.version = "1.7.3"
9
+ s.version = "1.8.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Recrea"]
14
- s.date = "2016-04-15"
14
+ s.date = "2016-05-09"
15
15
  s.description = " A ruby wrapper for Quaderno API "
16
16
  s.email = "carlos@recrea.es"
17
17
  s.extra_rdoc_files = [
@@ -42,6 +42,7 @@ Gem::Specification.new do |s|
42
42
  "lib/quaderno-ruby/invoice.rb",
43
43
  "lib/quaderno-ruby/item.rb",
44
44
  "lib/quaderno-ruby/payment.rb",
45
+ "lib/quaderno-ruby/receipt.rb",
45
46
  "lib/quaderno-ruby/recurring.rb",
46
47
  "lib/quaderno-ruby/tax.rb",
47
48
  "lib/quaderno-ruby/webhook.rb",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quaderno
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.3
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recrea
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-15 00:00:00.000000000 Z
11
+ date: 2016-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -83,6 +83,7 @@ files:
83
83
  - lib/quaderno-ruby/invoice.rb
84
84
  - lib/quaderno-ruby/item.rb
85
85
  - lib/quaderno-ruby/payment.rb
86
+ - lib/quaderno-ruby/receipt.rb
86
87
  - lib/quaderno-ruby/recurring.rb
87
88
  - lib/quaderno-ruby/tax.rb
88
89
  - lib/quaderno-ruby/webhook.rb