unleashed 0.1.7 → 0.1.8

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
  SHA256:
3
- metadata.gz: f5d6367c6d29e0b8c1e9034e5537a26450fd37cc321f8fe566a8a802ab12509d
4
- data.tar.gz: 21dbff509f3bbb40c1dd98ee4014881461c52b626a2ee235b0367c5cdf706557
3
+ metadata.gz: 7ffacf8f04243fffe2099a80a56ea810d82fd60a70ae3cf343eab0be4ba4dee9
4
+ data.tar.gz: f02cfd0bcf6664f8571360908557ba6286545c07b8936cf4e617d54303f9de82
5
5
  SHA512:
6
- metadata.gz: 0ef8902ad1494b3de7148f24a80211ab8f55d1e89af2984a422d70caad0a8557c7abf3cf2063fa4ea390dc3dc8e5661ec3648a8217df3413140274fdbc2b72e0
7
- data.tar.gz: bc6c05cbf0232a4c9e957104865e86a0c437abc37245898321971cf7924d8ddcb3fd12ae8c22a3eb7e355d6304b4bf12fa240dcdadfac7fe26125248000a9965
6
+ metadata.gz: 4144ef508cbca43006f4467616a44c008471c5585f87b837502538995f0920b95b7c284ad7eca2fa852c4020eb7c5de3181126b01711463fbd4fd1ad0d060228
7
+ data.tar.gz: fafc99a815f14e471d82754ddd923fd8e9d03a6f6a5f62afe03ae267736a2a5b72e17b3a80e2ea5cef3acce92e873a50c1fdd805c8efbaafb30564b7c9777954
data/README.md CHANGED
@@ -102,6 +102,18 @@ client.invoices.all
102
102
  client.invoices.find('XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX')
103
103
  ```
104
104
 
105
+ #### Get the first invoice
106
+
107
+ ```ruby
108
+ client.invoices.first
109
+ ```
110
+
111
+ #### Get the last invoice
112
+
113
+ ```ruby
114
+ client.invoices.last
115
+ ```
116
+
105
117
  ## 4. Contributing
106
118
 
107
119
  1. Fork it [https://github.com/nnhansg/unleashed-ruby](https://github.com/nnhansg/unleashed-ruby)
@@ -1,5 +1,6 @@
1
1
  module Unleashed
2
2
  # Manage Customers
3
3
  class Customer < BaseModel
4
+ attr_reader :attributes
4
5
  end
5
6
  end
@@ -1,6 +1,6 @@
1
1
  module Unleashed
2
2
  # Manage Invoices
3
3
  class Invoice < BaseModel
4
+ attr_reader :attributes
4
5
  end
5
6
  end
6
-
@@ -1,7 +1,7 @@
1
1
  module Unleashed
2
2
  # Resource for the Invoices API
3
3
  # The Invoices resource allows sales invoices to be listed and viewed.
4
- # An individual sales invoice details can be viewed by appending its identifier
4
+ # An individual sales invoice details can be viewed by appending its identifier
5
5
  # (a GUID formatted as XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX) to the URI.
6
6
  #
7
7
  # @see https://apidocs.unleashedsoftware.com/Invoices
@@ -34,6 +34,19 @@ module Unleashed
34
34
  response = JSON.parse(@client.get("Invoices/#{id}").body)
35
35
  Unleashed::Invoice.new(@client, response)
36
36
  end
37
+
38
+ # Get a first invoice in all
39
+ #
40
+ # @return [Unleashed::Invoice]
41
+ def first
42
+ all.first
43
+ end
44
+
45
+ # Get a last invoice in all
46
+ #
47
+ # @return [Unleashed::Invoice]
48
+ def last
49
+ all.last
50
+ end
37
51
  end
38
52
  end
39
-
@@ -2,7 +2,7 @@ module Unleashed
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 7
5
+ TINY = 8
6
6
 
7
7
  STRING = "#{MAJOR}.#{MINOR}.#{TINY}".freeze
8
8
  end
data/unleashed.gemspec CHANGED
@@ -40,8 +40,8 @@ Gem::Specification.new do |spec|
40
40
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
41
41
  spec.require_paths = ['lib']
42
42
 
43
- spec.add_dependency 'faraday'
44
- spec.add_dependency 'json'
43
+ spec.add_dependency 'faraday', '~> 0'
44
+ spec.add_dependency 'json', '~> 0'
45
45
  spec.add_development_dependency 'bundler', '~> 1.16', '>= 1.16.1'
46
46
  spec.add_development_dependency 'rake', '~> 10.0'
47
47
  spec.add_development_dependency 'rspec', '~> 3.0'
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unleashed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nhan Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-13 00:00:00.000000000 Z
11
+ date: 2019-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency