saasu2 0.1.0.pre → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef4f91281902664f17b2c52ee2871df934c51d42
4
- data.tar.gz: 43f634972cb7b6b9645d908e2961bf6c311c4f27
3
+ metadata.gz: 00d34d8d6d01b5a1ba07efb6a978829a6ca8e78f
4
+ data.tar.gz: 8864f8c57abb79e676cfc465e85f571e17f15c9c
5
5
  SHA512:
6
- metadata.gz: 25149c64b15e36ca720edd0fb41f238fcdad0d97eb8ec6760b59016ab952a72c2398f30c472fff8e21a97ec7860f7f1b5f2d1a0de66d8d1cccf86e099db2af62
7
- data.tar.gz: 9c6bda2d041394d1a57e92407ae9f3f20e8558d8c89e42296cd77fc43e49e75a2f6d55ccaa7910fea15c77c3b00267464a94e0e0463ed7690f6937de4670eda9
6
+ metadata.gz: e9289d659a6c7f098d3b1a85c3f81483b2fa699af3adce974b377d8ee899f94fa6ff850107aaffb7a82178fb2cf0c86474204e751c4f0e41f8f5b9a3cd2648e8
7
+ data.tar.gz: 87af3716b0aabaa9db71677d66322bf6100f293c7507fdc7e7e010e8986bba9fe25b244442741dd546f27a9d4a3b2c5c945532f911127cfe96030f00280c0cc3
data/README.md CHANGED
@@ -17,13 +17,70 @@ And then execute:
17
17
 
18
18
  $ bundle
19
19
 
20
- Or install it yourself as:
20
+ Create an initializer file with your Saasu configuration eg config/initilizers/saasu.rb
21
+ ```ruby
22
+ require 'saasu'
23
+
24
+ Saasu::Config.configure do |c|
25
+ c.username = 'username@email.com'
26
+ c.password = 'password'
27
+ c.file_id = 1234 # Your Saasu FileId can be found at
28
+ end
29
+ ```
30
+
31
+ You're now ready to connect your app to Saasu.
32
+
33
+ ## Usage
34
+
35
+ You can access the following objects:
36
+ - Saasu::Account
37
+ - Saasu::Company
38
+ - Saasu::Contact
39
+ - Saasu::Invoice
40
+ - Saasu::InvoiceAttachment
41
+ - Saasu::Item
42
+ - Saasu::Payment
43
+ - Saasu::TaxCode
44
+
45
+ Usage examples:
46
+
47
+ ```ruby
48
+ # get all contacts
49
+ contacts = Saasu::Contact.all
50
+
51
+ # find a contact by id
52
+ contact = Saasu::Contact.find(123)
53
+
54
+ # save a contact
55
+ contact.given_name = 'New Name'
56
+ contact.save
57
+
58
+ # delete a contact
59
+ contact.delete
60
+
61
+ # create a contact
62
+ new_contact = Saasu::Contact.create({ GivenName => 'User' })
63
+
64
+ # filter records. for a list of available filters for each object see https://api.saasu.com
65
+ contact = Saasu::Contact.where(GivenName: 'John')
66
+
67
+ # get attributes
68
+ contact.id
69
+ contact['Id']
70
+
71
+ # set attributes
72
+ contact.given_name = 'Nick'
73
+ contact['GivenName'] = 'John'
74
+
75
+ # get all attributes
76
+ contact.attributes
77
+ ```
21
78
 
22
- $ gem install saasu2
79
+ Note - Saasu uses .NET naming convention for fields and filters eg. GivenName, LastModifiedDate
23
80
 
24
81
  ## Contributing
25
82
 
26
- 1. Fork it ( https://github.com/[my-github-username]/saasu2/fork )
83
+ 1. Fork it ( https://github.com/saasu/saasu2-ruby/fork )
27
84
  2. Create your feature branch (`git checkout -b my-new-feature`)
28
85
  3. Commit your changes (`git commit -am 'Add some feature'`)
29
86
  4. Push to the branch (`git push origin my-new-feature`)
data/lib/saasu/base.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  module Saasu
2
2
  class Base
3
+ attr_reader :attributes
4
+
3
5
  def initialize(params = {})
4
6
  @attributes = params.deep_stringify_keys
5
7
  end
data/lib/saasu/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Saasu
2
- VERSION = "0.1.0.pre"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saasu2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sinenko
@@ -198,9 +198,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
198
198
  version: 1.9.0
199
199
  required_rubygems_version: !ruby/object:Gem::Requirement
200
200
  requirements:
201
- - - ">"
201
+ - - ">="
202
202
  - !ruby/object:Gem::Version
203
- version: 1.3.1
203
+ version: '0'
204
204
  requirements: []
205
205
  rubyforge_project:
206
206
  rubygems_version: 2.2.2