zoho_books 0.0.41 → 0.0.43

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: 585a879d5ea41b068f4463c17c4fc198f80b41bfcbe53f28885a968da83ec4c0
4
- data.tar.gz: 67365eb6b896b6e9bf03c8c5eff56aa83883be7ba9bcb35b984ca20b706f7896
3
+ metadata.gz: b0ce3462390ba5629004a1efe606ed08782f898003746fa9ade5b119982ad050
4
+ data.tar.gz: 3210d1dcefc680b66f4ba122e3691ad45fcf4fc182c083dd2f13c179ea23af4b
5
5
  SHA512:
6
- metadata.gz: d763d9eb0864e76276d0110ac1ee1bb4d7e174ecf15447d3233ca1599aa2c2514003cf25e34b9d79b3d758a27f80a18fb5f88021d59a58fd772278d37058e51b
7
- data.tar.gz: 604ca3da71ff52eae434b09dde3187694f035c02506b3db9123b409f487979f92a1edab91b1e32332a0d2a123db193365af25f583e270ea8d6d0cf52e9edf4dc
6
+ metadata.gz: 5880bbf96b8bec379729116e3ab4c09e6833472e5c2a6ea7b68ef37188f01568214d0f0bc716f8f7bf816996dc3013437a21056a24fbee800cc81253c6886535
7
+ data.tar.gz: 07efd3818cac9859d2f77d506fa1755c16d6f1e294aa0b9190e904683c1d45f7c183a76fcc44ad6267bf8e98ef31d406d09abed2b0c44e6f62ce76a6c03728ed
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  require 'httparty'
3
- require 'zoho_books/error'
4
- require_relative 'zoho_books/config'
5
3
 
6
4
  module ZohoBooks
7
5
  class Auth
@@ -0,0 +1,30 @@
1
+ module ZohoBooks
2
+ class Config
3
+ attr_accessor :client_id, :client_secret, :redirect_uri, :refresh_token, :base_url,
4
+ :portal_id, :access_token, :organization_id, :refresh_token, :access_token_expires_at
5
+
6
+ DEFAULT_BASE_URL = "https://accounts.zoho.eu".freeze
7
+
8
+ def initialize(config = {})
9
+ @base_url = config["base_url"] || DEFAULT_BASE_URL
10
+ @portal_id = config["portal_id"]
11
+ @access_token = config["access_token"]
12
+ @client_id = config["client_id"]
13
+ @client_secret = config["client_secret"]
14
+ @redirect_uri = config["redirect_uri"]
15
+ @organization_id = config["organization_id"]
16
+ @refresh_token = config["refresh_token"]
17
+
18
+ @access_token_expires_at = nil
19
+ end
20
+ end
21
+
22
+ class << self
23
+ attr_accessor :config
24
+
25
+ def configure
26
+ self.config ||= Config.new
27
+ yield(config)
28
+ end
29
+ end
30
+ end
data/lib/zoho_books.rb CHANGED
@@ -1,9 +1,9 @@
1
1
  module ZohoBooks
2
2
  end
3
3
 
4
- require_relative 'zoho_books/auth'
5
- require_relative 'zoho_books/error'
6
- require_relative 'zoho_books/connection'
7
- require_relative 'zoho_books/item'
8
- require_relative 'zoho_books/config'
4
+ require 'zoho_books/auth'
5
+ require 'zoho_books/error'
6
+ require 'zoho_books/connection'
7
+ require 'zoho_books/item'
8
+ require 'zoho_books/config'
9
9
 
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.41
4
+ version: 0.0.43
5
5
  platform: ruby
6
6
  authors:
7
7
  - PapaLoup
@@ -33,6 +33,7 @@ extra_rdoc_files: []
33
33
  files:
34
34
  - lib/zoho_books.rb
35
35
  - lib/zoho_books/auth.rb
36
+ - lib/zoho_books/config.rb
36
37
  - lib/zoho_books/error.rb
37
38
  homepage: https://rubygems.org/gems/zoho_books
38
39
  licenses: