zoho_books 0.0.5 → 0.0.6

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
  SHA256:
3
- metadata.gz: bb4b8600d21b217c2da5192625ef25fb2148a45bbe74107b19c34dba8c0dd8d2
4
- data.tar.gz: 0265b974da780a632dbd3c5a8bc441413a3c81ff04201c7bf7d4aa1ef83a2325
3
+ metadata.gz: 50914272ab350678fb813567bd0874a2c31b6e2ada8172d4e9635ec3c583d21e
4
+ data.tar.gz: 4f57bffb652672d0eee31050bbce58bc63c27fcdbad5ba92c7b9cb3363a271f5
5
5
  SHA512:
6
- metadata.gz: '08a246a314ef77fc8dac92e7d3ee6973aa6766c9783a793f641a342d91c94ac366fdad3ec09622c201a518ff0d03536dfe7d4279125b40423db7d5e06983879d'
7
- data.tar.gz: 4337a73f4112cd54a7c0cfd106f4f10c0f41bdea7cfb192615580814b105a03469324de06a9ad7e20d1407fa7696b1cefb9ce18016dbc4cf6c7c8e61eb3ac432
6
+ metadata.gz: 99ab636fbf3388b19b602be15726b0636dad6800995a25021f14b1d31ea7571a0ff8d80abdad2653f90f3a43e1f6e279dfc80df6e76cdc3c6f9a25fb86ad724c
7
+ data.tar.gz: deb65b9772fc6dd360ab8efb25aae0bc96796121b364bbcc659862414e8363f5df8492c4a661c463b556a511f55c81698cd75d490531f9226ec3186a7dc13fee
@@ -2,6 +2,8 @@
2
2
  require 'httparty'
3
3
 
4
4
  module ZohoBooks
5
+ BASE_URL='https://www.zohoapis.eu/books/v3'
6
+
5
7
  class Connection
6
8
 
7
9
  def self.get(url)
@@ -2,8 +2,6 @@
2
2
  require 'httparty'
3
3
 
4
4
  module ZohoBooks
5
- BASE_URL='https://www.zohoapis.eu/books/v3'
6
-
7
5
  class Contact
8
6
  def self.list(opts = {})
9
7
  query = opts.map { |k, v| "#{k}=#{v}" }.join('&')
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+ require 'httparty'
3
+
4
+ module ZohoBooks
5
+ class Estimate
6
+ def self.list(opts = {})
7
+ query = opts.map { |k, v| "#{k}=#{v}" }.join('&')
8
+ ZohoBooks::Connection.get("#{BASE_URL}/estimates?organization_id=#{ZohoBooks.config.organization_id}&#{query}")
9
+ end
10
+
11
+ def self.get(id, opts = {})
12
+ ZohoBooks::Connection.get("#{BASE_URL}/estimates/#{id}?organization_id=#{ZohoBooks.config.organization_id}")
13
+ end
14
+
15
+ def self.create(body, opts = {})
16
+ ZohoBooks::Connection.post("#{BASE_URL}/estimates?organization_id=#{ZohoBooks.config.organization_id}", body.to_json)
17
+ end
18
+
19
+ def self.update(id, body, opts = {})
20
+ ZohoBooks::Connection.put("#{BASE_URL}/estimates/#{id}?organization_id=#{ZohoBooks.config.organization_id}", body.to_json)
21
+ end
22
+
23
+ def self.delete(id, opts = {})
24
+ ZohoBooks::Connection.delete("#{BASE_URL}/estimates/#{id}?organization_id=#{ZohoBooks.config.organization_id}")
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+ require 'httparty'
3
+
4
+ module ZohoBooks
5
+ module Estimates
6
+ class Template
7
+ def self.list
8
+ ZohoBooks::Connection.get("#{BASE_URL}/estimates/templates?organization_id=#{ZohoBooks.config.organization_id}")
9
+ end
10
+ end
11
+ end
12
+ end
@@ -2,8 +2,6 @@
2
2
  require 'httparty'
3
3
 
4
4
  module ZohoBooks
5
- BASE_URL='https://www.zohoapis.eu/books/v3'
6
-
7
5
  class Item
8
6
  def self.list(opts = {})
9
7
  query = opts.map { |k, v| "#{k}=#{v}" }.join('&')
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+ require 'httparty'
3
+
4
+ module ZohoBooks
5
+ class Tax
6
+ def self.list(opts = {})
7
+ query = opts.map { |k, v| "#{k}=#{v}" }.join('&')
8
+ ZohoBooks::Connection.get("#{BASE_URL}/settings/taxes?organization_id=#{ZohoBooks.config.organization_id}&#{query}")
9
+ end
10
+
11
+ def self.get(id, opts = {})
12
+ ZohoBooks::Connection.get("#{BASE_URL}/settings/taxes/#{id}?organization_id=#{ZohoBooks.config.organization_id}")
13
+ end
14
+
15
+ def self.create(body, opts = {})
16
+ ZohoBooks::Connection.post("#{BASE_URL}/settings/taxes?organization_id=#{ZohoBooks.config.organization_id}", body.to_json)
17
+ end
18
+
19
+ def self.update(id, body, opts = {})
20
+ ZohoBooks::Connection.put("#{BASE_URL}/settings/taxes/#{id}?organization_id=#{ZohoBooks.config.organization_id}", body.to_json)
21
+ end
22
+
23
+ def self.delete(id, opts = {})
24
+ ZohoBooks::Connection.delete("#{BASE_URL}/settings/taxes/#{id}?organization_id=#{ZohoBooks.config.organization_id}")
25
+ end
26
+ end
27
+ end
data/lib/zoho_books.rb CHANGED
@@ -7,4 +7,6 @@ require 'zoho_books/connection'
7
7
  require 'zoho_books/item'
8
8
  require 'zoho_books/config'
9
9
  require 'zoho_books/contact'
10
-
10
+ require 'zoho_books/estimate'
11
+ require 'zoho_books/estimates/template'
12
+ require 'zoho_books/tax'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zoho_books
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - PapaLoup
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-10-02 00:00:00.000000000 Z
13
+ date: 2023-10-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty
@@ -38,7 +38,10 @@ files:
38
38
  - lib/zoho_books/connection.rb
39
39
  - lib/zoho_books/contact.rb
40
40
  - lib/zoho_books/error.rb
41
+ - lib/zoho_books/estimate.rb
42
+ - lib/zoho_books/estimates/template.rb
41
43
  - lib/zoho_books/item.rb
44
+ - lib/zoho_books/tax.rb
42
45
  homepage: https://rubygems.org/gems/zoho_books
43
46
  licenses:
44
47
  - MIT