koho 0.0.7 → 0.0.8
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.
- data/lib/koho/version.rb +1 -1
 - data/lib/koho.rb +46 -1
 - metadata +2 -2
 
    
        data/lib/koho/version.rb
    CHANGED
    
    
    
        data/lib/koho.rb
    CHANGED
    
    | 
         @@ -18,7 +18,6 @@ module Koho 
     | 
|
| 
       18 
18 
     | 
    
         
             
                  @token = token
         
     | 
| 
       19 
19 
     | 
    
         
             
                end
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
       22 
21 
     | 
    
         
             
                def get action, data = {}
         
     | 
| 
       23 
22 
     | 
    
         
             
                  JSON.parse(self.class.get action, query: data.merge(company_id: @company_id, token: @token))
         
     | 
| 
       24 
23 
     | 
    
         
             
                end
         
     | 
| 
         @@ -31,8 +30,13 @@ module Koho 
     | 
|
| 
       31 
30 
     | 
    
         
             
                  JSON.parse(self.class.put action, {method: '_PUT', body: {company_id: @company_id, token: @token}.merge(data)})
         
     | 
| 
       32 
31 
     | 
    
         
             
                end
         
     | 
| 
       33 
32 
     | 
    
         | 
| 
      
 33 
     | 
    
         
            +
                def delete action
         
     | 
| 
      
 34 
     | 
    
         
            +
                  JSON.parse(self.class.delete action, {method: '_DELETE', body: {company_id: @company_id, token: @token}})
         
     | 
| 
      
 35 
     | 
    
         
            +
                end
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
       34 
37 
     | 
    
         
             
                def customers; Customers.new company_id, token; end
         
     | 
| 
       35 
38 
     | 
    
         
             
                def invoices; Invoices.new company_id, token; end
         
     | 
| 
      
 39 
     | 
    
         
            +
                def inbound_invoices; InboundInvoices.new company_id, token; end
         
     | 
| 
       36 
40 
     | 
    
         
             
                def invoice_terms; InvoiceTerms.new company_id, token; end
         
     | 
| 
       37 
41 
     | 
    
         
             
                def contracts; Contracts.new company_id, token; end
         
     | 
| 
       38 
42 
     | 
    
         | 
| 
         @@ -42,6 +46,35 @@ module Koho 
     | 
|
| 
       42 
46 
     | 
    
         
             
                  get '/info'
         
     | 
| 
       43 
47 
     | 
    
         
             
                end
         
     | 
| 
       44 
48 
     | 
    
         | 
| 
      
 49 
     | 
    
         
            +
                class InboundInvoices< Koho::Client
         
     | 
| 
      
 50 
     | 
    
         
            +
                  
         
     | 
| 
      
 51 
     | 
    
         
            +
                  base_uri  API_BASE_URL+'/invoice_inbounds'
         
     | 
| 
      
 52 
     | 
    
         
            +
             
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
      
 54 
     | 
    
         
            +
                  def list
         
     | 
| 
      
 55 
     | 
    
         
            +
                    get '/'
         
     | 
| 
      
 56 
     | 
    
         
            +
                  end
         
     | 
| 
      
 57 
     | 
    
         
            +
             
     | 
| 
      
 58 
     | 
    
         
            +
                  def find id
         
     | 
| 
      
 59 
     | 
    
         
            +
                    get "/#{id}"
         
     | 
| 
      
 60 
     | 
    
         
            +
                  end
         
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
| 
      
 62 
     | 
    
         
            +
             
     | 
| 
      
 63 
     | 
    
         
            +
                  def create params
         
     | 
| 
      
 64 
     | 
    
         
            +
                    post '/', invoice_inbound: params
         
     | 
| 
      
 65 
     | 
    
         
            +
                  end
         
     | 
| 
      
 66 
     | 
    
         
            +
             
     | 
| 
      
 67 
     | 
    
         
            +
                  def update id, params
         
     | 
| 
      
 68 
     | 
    
         
            +
                    put "/#{id}", invoice_inbound: params
         
     | 
| 
      
 69 
     | 
    
         
            +
                  end
         
     | 
| 
      
 70 
     | 
    
         
            +
             
     | 
| 
      
 71 
     | 
    
         
            +
                  def destroy id
         
     | 
| 
      
 72 
     | 
    
         
            +
                    delete "/#{id}"
         
     | 
| 
      
 73 
     | 
    
         
            +
                  end
         
     | 
| 
      
 74 
     | 
    
         
            +
                  
         
     | 
| 
      
 75 
     | 
    
         
            +
             
     | 
| 
      
 76 
     | 
    
         
            +
                end
         
     | 
| 
      
 77 
     | 
    
         
            +
             
     | 
| 
       45 
78 
     | 
    
         
             
                class Invoices < Koho::Client
         
     | 
| 
       46 
79 
     | 
    
         | 
| 
       47 
80 
     | 
    
         
             
                  base_uri  API_BASE_URL+'/invoices'
         
     | 
| 
         @@ -70,6 +103,10 @@ module Koho 
     | 
|
| 
       70 
103 
     | 
    
         
             
                  def update id, params
         
     | 
| 
       71 
104 
     | 
    
         
             
                    put "/#{id}", invoice: params
         
     | 
| 
       72 
105 
     | 
    
         
             
                  end
         
     | 
| 
      
 106 
     | 
    
         
            +
             
     | 
| 
      
 107 
     | 
    
         
            +
                  def destroy id
         
     | 
| 
      
 108 
     | 
    
         
            +
                    delete "/#{id}"
         
     | 
| 
      
 109 
     | 
    
         
            +
                  end
         
     | 
| 
       73 
110 
     | 
    
         | 
| 
       74 
111 
     | 
    
         | 
| 
       75 
112 
     | 
    
         
             
                end
         
     | 
| 
         @@ -94,6 +131,10 @@ module Koho 
     | 
|
| 
       94 
131 
     | 
    
         
             
                  def update id, params
         
     | 
| 
       95 
132 
     | 
    
         
             
                    put "/#{id}", customer: params
         
     | 
| 
       96 
133 
     | 
    
         
             
                  end
         
     | 
| 
      
 134 
     | 
    
         
            +
             
     | 
| 
      
 135 
     | 
    
         
            +
                  def destroy id
         
     | 
| 
      
 136 
     | 
    
         
            +
                    delete "/#{id}"
         
     | 
| 
      
 137 
     | 
    
         
            +
                  end
         
     | 
| 
       97 
138 
     | 
    
         | 
| 
       98 
139 
     | 
    
         | 
| 
       99 
140 
     | 
    
         
             
                end
         
     | 
| 
         @@ -139,6 +180,10 @@ module Koho 
     | 
|
| 
       139 
180 
     | 
    
         
             
                    put "/#{id}", contract: params
         
     | 
| 
       140 
181 
     | 
    
         
             
                  end
         
     | 
| 
       141 
182 
     | 
    
         | 
| 
      
 183 
     | 
    
         
            +
                  def destroy id
         
     | 
| 
      
 184 
     | 
    
         
            +
                    delete "/#{id}"
         
     | 
| 
      
 185 
     | 
    
         
            +
                  end
         
     | 
| 
      
 186 
     | 
    
         
            +
             
     | 
| 
       142 
187 
     | 
    
         
             
                end
         
     | 
| 
       143 
188 
     | 
    
         | 
| 
       144 
189 
     | 
    
         
             
              end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: koho
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.8
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors:
         
     | 
| 
         @@ -9,7 +9,7 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date: 2013-10- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2013-10-08 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              type: :development
         
     |