flexibee 0.1.0 → 0.3.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: 50e549f3e255233fc31d03f6ed94d1b5ebf9d63f
4
- data.tar.gz: 04fa0d0fb1f4c6bf9ffb8f397e4cb449af8df7ec
3
+ metadata.gz: 23dc2151e15956e2d264d09cb63752d2d31a8d05
4
+ data.tar.gz: 932392faeb05668417df84fc2863d676c9c4bb7b
5
5
  SHA512:
6
- metadata.gz: 9b4a504168ad797d21ff605f95da82b51eb1d669fb83a9a8b4e46b3e563265c5415371b7a2f59d91032a90ac5b981421f75e037e758100443b70c3e5e905aa13
7
- data.tar.gz: 36d2dfe46c0c5de1b5c4a63c75f246a9ff77d2e0bd4475b80206220ac420a6cebd94326caa1d0dc791a6f2ebeff861acb119723ad7729d6c80241ee0a8f6c1fc
6
+ metadata.gz: 9b19e3cbe16941e814212560ebb78ad17508000fecc4a14eb50bf730ea9566befd3449a9ca6355a3742ab52b93674021c0ae88706b9f83f7b8ebe5f253b93a78
7
+ data.tar.gz: 14695ac1502b56c7dbdd0a8fc53f3c76a3e0b6a3cf7b8a2472d76936dde0e65c7bf14640ae3954ccc27d80908cd039df9ba6e4f752c4c86fe184edea9fd47de0
data/.gitignore CHANGED
@@ -8,3 +8,5 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  .idea
11
+
12
+ tags
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
1
  --format documentation
2
2
  --color
3
+ --require spec_helper
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
- # Flexibee
1
+ # Flexibee [![Build Status](https://travis-ci.org/danpecher/flexibee.rb.svg?branch=master)](https://travis-ci.org/danpecher/flexibee.rb)
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/flexibee`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Ruby wrapper for Flexibee JSON REST API (docs to be found [here](https://www.flexibee.eu/api/dokumentace/))
6
4
 
7
5
  ## Installation
8
6
 
@@ -22,7 +20,215 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
23
+ ### Connection
24
+
25
+ To get base client object for establishing connection do:
26
+
27
+ ```
28
+ @user_id = 'USERID'
29
+ @login = 'LOGIN'
30
+ @password = 'PWD'
31
+ @company = 'COMPANY'
32
+
33
+ @flexibee = Flexibee::Client.new(@user_id, @login, @password, @company)
34
+ ```
35
+
36
+ Then you can proceed to access data:
37
+
38
+ ### Company
39
+
40
+ can be accessed by:
41
+
42
+ ```ruby
43
+ company = @flexibee.company
44
+ ```
45
+
46
+ it has attributes:
47
+
48
+ ```ruby
49
+ company.info
50
+ company.id
51
+ company.name
52
+ company.db_name
53
+ company.created_at
54
+ ```
55
+
56
+
57
+ ### Invoice Types
58
+
59
+ can be accessed by:
60
+
61
+ ```ruby
62
+ invoice_types = @flexibee.invoice_types
63
+ ```
64
+
65
+ returns array of Flexibee::InvoiceType Structs
66
+
67
+ Flexibee::InvoiceType has attributes:
68
+
69
+ ```ruby
70
+ invoice_types.first.id
71
+ invoice_types.first.updated_at
72
+ invoice_types.first.code
73
+ invoice_types.first.name
74
+ invoice_types.first.currency
75
+ invoice_types.first.currency_ref
76
+ invoice_types.first.currency_name
77
+ ```
78
+
79
+ ### Order Types
80
+
81
+ can be accessed by:
82
+
83
+ ```ruby
84
+ order_types = @flexibee.order_types
85
+ ```
86
+
87
+ returns array of Flexibee::OrderType Structs
88
+
89
+ Flexibee::OrderType has attributes:
90
+
91
+ ```ruby
92
+ order_types.first.id
93
+ order_types.first.updated_at
94
+ order_types.first.code
95
+ order_types.first.name
96
+ order_types.first.currency
97
+ order_types.first.currency_ref
98
+ order_types.first.currency_name
99
+ ```
100
+
101
+ ### Product List
102
+
103
+ can be accessed by:
104
+
105
+ ```ruby
106
+ product_list = @flexibee.product_list
107
+ ```
108
+
109
+ returns Flexibee::ProductList and you can call `all` to get array of Flexibee::Product objects
110
+
111
+ ```ruby
112
+ all_products = product_list.all
113
+ ```
114
+
115
+ to iterate through products you can pass it params `start` and `limit`
116
+
117
+ ```ruby
118
+ not_all_products = product_list.all({ start: 120, limit: 100})
119
+ ```
120
+
121
+ `all_products` and `not_all_products` are now arrays of products and you can iterate through Flexibee::Product objects in it, it has these attributes:
122
+
123
+ ```ruby
124
+ all_products.first.id
125
+ all_products.first.updated_at
126
+ all_products.first.code
127
+ all_products.first.name
128
+ all_products.first.price_base
129
+ all_products.first.price_no_vat
130
+ all_products.first.price_vat
131
+ all_products.first.stock
132
+ all_products.first.note
133
+ all_products.first.description
134
+ all_products.first.ean
135
+ all_products.first.vat
136
+ all_products.first.client
137
+ ```
138
+
139
+ you can filter by id, name and ean to ease your work using these methods on product list:
140
+ (They return first match from your products -> Flexibee::Product)
141
+
142
+ ```ruby
143
+ product_list.find_by_id(2345)
144
+ ```
145
+
146
+ ```ruby
147
+ product_list.find_by_name('My fancy product Blue/Red')
148
+ ```
149
+
150
+ ```ruby
151
+ product_list.find_by_ean('9343783000326')
152
+ ```
153
+
154
+
155
+ ### Tree (Categories of products - Flexibee 'strom')
156
+
157
+ Hard to find, you have to use desktop app to access these (is the tree on the left hand side in desktop app once on price list)
158
+
159
+ can be accessed by:
160
+
161
+ ```ruby
162
+ tree = @flexibee.tree
163
+ ```
164
+
165
+ returns Flexibee::Tree and you can call `all` to get array of Flexibee::Node objects
166
+
167
+ ```ruby
168
+ nodes = tree.all
169
+ ```
170
+
171
+ you can also access some additional custom sets of nodes for convenience:
172
+
173
+ to get root node call (returns Flexibee::Node):
174
+ ```ruby
175
+ root = tree.root
176
+ ```
177
+
178
+ to access all nodes on certain level (returns array of Flexibee::Node):
179
+ ```ruby
180
+ nodes = tree.level(3)
181
+ ```
182
+
183
+ you can lookup node by id (returns array of Flexibee::Node):
184
+ ```ruby
185
+ nodes = tree.find_by_id(34)
186
+ ```
187
+
188
+ ### Node
189
+
190
+ to describe Flexibee::Node better (see Tree described above which is full of them)
191
+
192
+ once you get node from tree (example):
193
+ ```ruby
194
+ node = @flexibee.tree.first
195
+ ```
196
+
197
+ you can access these attributes:
198
+ ```ruby
199
+ node.id
200
+ node.updated_at
201
+ node.code
202
+ node.name
203
+ node.level
204
+ node.order
205
+ node.route
206
+ node.short_description
207
+ node.keywords
208
+ node.description
209
+ node.tree_ref
210
+ node.parent_id
211
+ node.parent_ref
212
+ ```
213
+
214
+ also you can display all descendants of the node (array of Flexibee::Node):
215
+ ```ruby
216
+ desc = node.descendants
217
+ ```
218
+
219
+ or you can display parent of the node (Flexibee::Node):
220
+ ```ruby
221
+ parent = node.parent
222
+ ```
223
+
224
+
225
+ ## TODO
226
+
227
+ * raw for response (if I left out something you want to display)
228
+ * filtering for all
229
+ * invoices
230
+ * sending to flexibee
231
+
26
232
 
27
233
  ## Development
28
234
 
@@ -38,4 +244,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERN
38
244
  ## License
39
245
 
40
246
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
-
data/flexibee.gemspec CHANGED
@@ -19,11 +19,12 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_development_dependency "bundler", "~> 1.11"
23
- spec.add_development_dependency "rake", "~> 10.0"
24
- spec.add_development_dependency "rspec", "~> 3.0"
22
+ spec.add_development_dependency 'bundler'
23
+ spec.add_development_dependency 'rake'
24
+ spec.add_development_dependency 'rspec'
25
25
  spec.add_development_dependency 'webmock'
26
26
  spec.add_development_dependency 'vcr'
27
+ spec.add_development_dependency 'pry'
27
28
 
28
29
  spec.add_dependency 'rest-client'
29
30
  end
data/lib/flexibee.rb CHANGED
@@ -1,18 +1,12 @@
1
1
  require 'flexibee/version'
2
- require 'flexibee/client/company'
3
- require 'flexibee/client/product'
4
- require 'flexibee/client/invoice_type'
5
- require 'flexibee/client/order_type'
2
+ require 'flexibee/company'
3
+ require 'flexibee/product_list'
4
+ require 'flexibee/product'
5
+ require 'flexibee/invoice_types'
6
+ require 'flexibee/order_types'
7
+ require 'flexibee/tree'
8
+ require 'flexibee/node'
6
9
  require 'flexibee/client'
7
10
 
8
11
  module Flexibee
9
-
10
- class << self
11
- def method_missing(method_name, *args, &block)
12
- @client.send(method_name, *args, &block) if @client.respond_to? method_name
13
-
14
- super
15
- end
16
- end
17
-
18
12
  end
@@ -1,28 +1,83 @@
1
1
  require 'rest-client'
2
+ require 'erb'
2
3
 
3
4
  module Flexibee
4
5
  class Client
5
- include Flexibee::Client::Company
6
- include Flexibee::Client::Product
7
- include Flexibee::Client::InvoiceType
8
- include Flexibee::Client::OrderType
9
-
6
+ ##
7
+ # working with base response from flexibee
8
+ #
9
+ # {
10
+ # "companies" => {
11
+ # "company" => {
12
+ # "createDt" => "2015-10-17T18:26:39.692+02:00",
13
+ # "dbNazev" => "esperia_test",
14
+ # "id" => "1",
15
+ # "licenseGroup" => "04fc91491a9647d451649736ad8127e2",
16
+ # "nazev" => "esperia-test",
17
+ # "show" => "true",
18
+ # "stavEnum" => "ESTABLISHED",
19
+ # "watchingChanges" => "false"
20
+ # }
21
+ # }
22
+ # }
23
+ ##
10
24
  def initialize(user_id, login, password, company_id)
11
25
  @user_id = user_id
12
26
  @login = login
13
27
  @password = password
14
28
  @company_id = company_id
29
+ end
30
+
31
+ def base_url
32
+ "https://#{@login}:#{@password}@#{@user_id}.flexibee.eu:5434/c/#{@company_id}"
33
+ end
34
+
35
+ def base_response
36
+ get
37
+ end
38
+
39
+ ##
40
+ # flexibee obejcts
41
+ ##
42
+ def company
43
+ @company ||= Company.new(base_response)
44
+ end
15
45
 
16
- @base_url = "https://#{login}:#{password}@#{user_id}.flexibee.eu:5434/c/#{company_id}"
46
+ def invoice_types
47
+ @invoice_types = InvoiceTypes.new(self).invoice_types
17
48
  end
18
49
 
19
- def get(url, params = {}, filter = nil)
50
+ def order_types
51
+ @order_types = OrderTypes.new(self).order_types
52
+ end
53
+
54
+ def product_list
55
+ @products = ProductList.new(self)
56
+ end
57
+
58
+ ##
59
+ # By default called with { detail: 'full' }, normal response does not have any usefull information in it
60
+ # Also to get whole list of categories default passes { limit: 0 } to get default pass { limit: 20 }
61
+ ##
62
+ def tree
63
+ @tree = Tree.new(self)
64
+ end
65
+
66
+ ##
67
+ # flexibee base call methods
68
+ ##
69
+ def get(route='', params = {}, filter = nil)
70
+ url = base_url + route
20
71
  unless filter.nil?
21
- url << '/' + URI::escape("(#{filter})")
72
+ url << '/' + "(#{ERB::Util.url_encode(filter)})"
22
73
  end
23
74
  url << '.json'
24
- JSON.parse(RestClient.get(url, params))
75
+ begin
76
+ JSON.parse(RestClient.get(url, params: params))
77
+ rescue RestClient::ResourceNotFound => e
78
+ Object.new
79
+ end
25
80
  end
26
81
 
27
82
  end
28
- end
83
+ end
@@ -0,0 +1,31 @@
1
+ module Flexibee
2
+ class Company
3
+ ##
4
+ # getting custom info from company response
5
+ #
6
+ # {
7
+ # "companies" => {
8
+ # "company" => {
9
+ # "createDt" => "2015-10-17T18:26:39.692+02:00",
10
+ # "dbNazev" => "esperia_test",
11
+ # "id" => "1",
12
+ # "licenseGroup" => "04fc91491a9647d451649736ad8127e2",
13
+ # "nazev" => "esperia-test",
14
+ # "show" => "true",
15
+ # "stavEnum" => "ESTABLISHED",
16
+ # "watchingChanges" => "false"
17
+ # }
18
+ # }
19
+ # }
20
+ ##
21
+ attr_accessor :info, :id, :name, :db_name, :created_at
22
+
23
+ def initialize(response)
24
+ @info = response['companies']['company']
25
+ @id = response['companies']['company']['id']
26
+ @name = response['companies']['company']['nazev']
27
+ @db_name = response['companies']['company']['dbNazev']
28
+ @created_at = response['companies']['company']['createDt']
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,23 @@
1
+ module Flexibee
2
+ InvoiceType = Struct.new(:id, :updated_at, :code, :name, :currency,
3
+ :currency_ref, :currency_name)
4
+
5
+ class InvoiceTypes
6
+ def initialize(client)
7
+ @client = client
8
+ end
9
+
10
+ def invoice_types
11
+ find.map do |type|
12
+ currency = type['mena'].split(':').last
13
+ currency_name = type['mena@showAs'].split(':').last.strip
14
+ Flexibee::InvoiceType.new(type['id'], type['lastUpdate'],
15
+ type['kod'], type['nazev'], currency, type['mena@ref'], currency_name)
16
+ end
17
+ end
18
+
19
+ def find(filter=nil)
20
+ @client.get("/typ-faktury-vydane", {}, filter)['winstrom']['typ-faktury-vydane']
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,65 @@
1
+ module Flexibee
2
+ class Node
3
+ ##
4
+ # One node response in detail=full mode
5
+ #
6
+ # {
7
+ # id: "2",
8
+ # lastUpdate: "2015-07-03T09:52:25.048+02:00",
9
+ # kod: "root",
10
+ # nazev: "Připojené položky",
11
+ # nazevA: "",
12
+ # nazevB: "",
13
+ # nazevC: "",
14
+ # strobr: "",
15
+ # hladina: "2",
16
+ # poradi: "1",
17
+ # cesta: "1/1/",
18
+ # kratkyPopis: "",
19
+ # klicSlova: "",
20
+ # popis: "",
21
+ # txtNad: "",
22
+ # txtPod: "",
23
+ # strom: "code:STR_CEN",
24
+ # strom@ref: "/c/woodies/strom-koren/1.json",
25
+ # strom@showAs: "STR_CEN: Strom ceníku",
26
+ # otec: "1",
27
+ # otec@ref: "/c/woodies/strom/1.json",
28
+ # otec@showAs: "Strom ceníku"
29
+ # }
30
+ ##
31
+ attr_accessor :id, :updated_at, :code, :name, :level, :order, :route, :short_description,
32
+ :keywords, :description, :tree_ref, :parent_id, :parent_ref, :tree
33
+
34
+ def initialize(response, tree)
35
+ @id = response['id'].to_i
36
+ @updated_at = response['lastUpdate']
37
+ @code = response['kod']
38
+ @name = response['nazev']
39
+ @level = response['hladina'].to_i
40
+ @order = response['poradi'].to_i
41
+ @route = response['cesta']
42
+ @short_description = response['kratkyPopis']
43
+ @keywords = response['klicSlova']
44
+ @description = response['popis']
45
+ @tree_ref = response['strom@ref']
46
+ @parent_id = response['otec'].to_i
47
+ @parent_ref = response['otec@ref']
48
+ @tree = tree
49
+ end
50
+
51
+ ##
52
+ # all children of the node
53
+ ##
54
+ def descendants
55
+ tree.children_of(id)
56
+ end
57
+
58
+ ##
59
+ # parent of the node
60
+ ##
61
+ def parent
62
+ tree.parent_for(parent_id).first
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,23 @@
1
+ module Flexibee
2
+ OrderType = Struct.new(:id, :updated_at, :code, :name, :currency,
3
+ :currency_ref, :currency_name)
4
+
5
+ class OrderTypes
6
+ def initialize(client)
7
+ @client = client
8
+ end
9
+
10
+ def order_types
11
+ find.map do |type|
12
+ currency = type['mena'].split(':').last
13
+ currency_name = type['mena@showAs'].split(':').last.strip
14
+ Flexibee::OrderType.new(type['id'], type['lastUpdate'],
15
+ type['kod'], type['nazev'], currency, type['mena@ref'], currency_name)
16
+ end
17
+ end
18
+
19
+ def find(filter=nil)
20
+ @client.get("/typ-objednavky-vydane", {}, filter)['winstrom']['typ-objednavky-vydane']
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,51 @@
1
+ module Flexibee
2
+ class Product
3
+ attr_accessor :id, :updated_at, :code, :name, :price_base, :price_no_vat,
4
+ :price_vat, :stock, :note, :description, :ean, :vat
5
+
6
+ ##
7
+ # Product basic response
8
+ #
9
+ # {
10
+ # "id" => "4797",
11
+ # "lastUpdate" => "2015-09-30T15:42:45.190+02:00",
12
+ # "kod" => "B0002",
13
+ # "nazev" => "Dámský zvýhodněný balíček",
14
+ # "cenaZakl" => "1361.157024",
15
+ # "cenaZaklBezDph" => "1361.157024",
16
+ # "cenaZaklVcDph" => "1646.999999",
17
+ # "sumDostupMj" => "0.0",
18
+ # "poznam" => "NENÍ FOTO",
19
+ # "popis" => "",
20
+ # "eanKod" => "",
21
+ # "szbDph" => "21.0"
22
+ # }
23
+ ##
24
+ def initialize(response, client)
25
+ @id = response['id'].to_i
26
+ @updated_at = response['lastUpdate']
27
+ @code = response['kod']
28
+ @name = response['nazev']
29
+ @price_base = response['cenaZakl'].to_f
30
+ @price_no_vat = response['cenaZaklBezDph'].to_f
31
+ @price_vat = response['cenaZaklVcDph'].to_f
32
+ @stock = response['sumDostupMj'].to_f
33
+ @note = response['poznam']
34
+ @description = response['popis']
35
+ @ean = response['eanKod']
36
+ @vat = response['szbDph'].to_f
37
+ @client = client
38
+ end
39
+
40
+ # TODO test
41
+ def category
42
+ uzel_id = find_relationship ? find_relationship['uzel'] : find_relationship
43
+ uzel_id ? @client.tree.find_by_id(uzel_id.to_i).first : nil
44
+ end
45
+
46
+ # TODO test
47
+ def find_relationship
48
+ @client.get("/strom-cenik", { detail: 'full' }, "idZaznamu='#{id}'")['winstrom']['strom-cenik'][0]
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,36 @@
1
+ module Flexibee
2
+ class ProductList
3
+ ##
4
+ # By default called with { detail: 'full' }, normal response does not have any usefull information in it
5
+ ##
6
+ def initialize(client)
7
+ @client = client
8
+ end
9
+
10
+ def all(params={})
11
+ create_products(find(nil, params))
12
+ end
13
+
14
+ def find(filter=nil, params={})
15
+ @client.get("/cenik", params.merge({ detail: 'full' }), filter)['winstrom']['cenik']
16
+ end
17
+
18
+ def find_by_id(id)
19
+ create_products(find("id='#{id}'")).first
20
+ end
21
+
22
+ def find_by_name(name)
23
+ create_products(find("nazev='#{name}'")).first
24
+ end
25
+
26
+ def find_by_ean(ean)
27
+ create_products(find("eanKod='#{ean}'")).first
28
+ end
29
+
30
+ private
31
+
32
+ def create_products(response)
33
+ response.map { |p| Flexibee::Product.new(p, @client) }
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,41 @@
1
+ module Flexibee
2
+ class Tree
3
+ def initialize(client)
4
+ @client = client
5
+ end
6
+
7
+ def all
8
+ create_nodes(find)
9
+ end
10
+
11
+ def find(filter=nil)
12
+ @client.get("/strom", { detail: 'full', limit: 0 }, filter)['winstrom']['strom']
13
+ end
14
+
15
+ def root
16
+ level.first
17
+ end
18
+
19
+ def level(level=1)
20
+ create_nodes(find("hladina='#{level}'"))
21
+ end
22
+
23
+ def find_by_id(id)
24
+ create_nodes(find("id='#{id}'"))
25
+ end
26
+
27
+ def children_of(node_id)
28
+ create_nodes(find("otec='#{node_id}'"))
29
+ end
30
+
31
+ def parent_for(parent_id)
32
+ create_nodes(find("id='#{parent_id}'"))
33
+ end
34
+
35
+ private
36
+
37
+ def create_nodes(response)
38
+ response.map{ |n| Flexibee::Node.new(n, self) }
39
+ end
40
+ end
41
+ end
@@ -1,3 +1,3 @@
1
1
  module Flexibee
2
- VERSION = "0.1.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flexibee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Pecher
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-16 00:00:00.000000000 Z
11
+ date: 2016-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.11'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.11'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '3.0'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: webmock
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: rest-client
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -114,10 +128,13 @@ files:
114
128
  - flexibee.gemspec
115
129
  - lib/flexibee.rb
116
130
  - lib/flexibee/client.rb
117
- - lib/flexibee/client/company.rb
118
- - lib/flexibee/client/invoice_type.rb
119
- - lib/flexibee/client/order_type.rb
120
- - lib/flexibee/client/product.rb
131
+ - lib/flexibee/company.rb
132
+ - lib/flexibee/invoice_types.rb
133
+ - lib/flexibee/node.rb
134
+ - lib/flexibee/order_types.rb
135
+ - lib/flexibee/product.rb
136
+ - lib/flexibee/product_list.rb
137
+ - lib/flexibee/tree.rb
121
138
  - lib/flexibee/version.rb
122
139
  homepage: https://github.com/danpecher/flexibee
123
140
  licenses:
@@ -1,9 +0,0 @@
1
- module Flexibee
2
- class Client
3
- module Company
4
- def company_info
5
- get("#{@base_url}")['companies']['company']
6
- end
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module Flexibee
2
- class Client
3
- module InvoiceType
4
- def invoice_types(params = {}, filter = nil)
5
- get("#{@base_url}/typ-faktury-vydane", params, filter)['winstrom']['typ-faktury-vydane']
6
- end
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module Flexibee
2
- class Client
3
- module OrderType
4
- def order_types(params = {}, filter = nil)
5
- get("#{@base_url}/typ-objednavky-vydane", params, filter)['winstrom']['typ-objednavky-vydane']
6
- end
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module Flexibee
2
- class Client
3
- module Product
4
- def product_list(params = {}, filter = nil)
5
- get("#{@base_url}/cenik", params, filter)['winstrom']['cenik']
6
- end
7
- end
8
- end
9
- end