xsys 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28b6a99b805814f89bf11b81102563984899bdf6
4
- data.tar.gz: c8eb0ad49e3fdce9cc67132ca353d8dba0600b80
3
+ metadata.gz: fe4ef043a8939c8fb0c3068a95def4258ea20cc3
4
+ data.tar.gz: 3066b6543ca98cd70577434c09ef5725fa5b08c8
5
5
  SHA512:
6
- metadata.gz: b7dbcd0b941704909685fca2863d69a66060bea847a8af7cc895be70e4a146f31369210da5db1ec158b1d2a5ba7a066e49bdef036cc6fc6b974407ff42879da5
7
- data.tar.gz: d5b17af0e6a351b47a003949a9fc6ed795d0f70b1fd611266001c84e6e4c4c747d4edd3fa56519b61fe0add3db2cab9bcbdf9e2c6555eff6429647e87a57f8f6
6
+ metadata.gz: d65b186ec0f7f17e0536149690d11f4a87c91e227bbf88ad4c61fe887d1bd090db6158125e636bf802eb295f666faa2b02ece110ba991119532f4bbc033947b0
7
+ data.tar.gz: 2df847238579c25baef28ee71249909763cd60f481a58a443c95168201818103fe85315b9726aaf69bf19ee9ba1e03b25f4448a20679e4baa5fd92fedc383685
data/CHANGELOG.md CHANGED
@@ -133,3 +133,7 @@
133
133
  ## v0.2.4
134
134
 
135
135
  * Fixed null end date in background jobs
136
+
137
+ ## v0.2.5
138
+
139
+ * Endpoint default changed
data/lib/xsys/api.rb CHANGED
@@ -1,29 +1,29 @@
1
1
  module Xsys
2
2
  class Api
3
3
  def self.configure(args={})
4
- @endpoint = (args[:endpoint] || 'https://gestion.lhconfort.com.ar/api')
4
+ @endpoint = (args[:endpoint] || 'https://gestion.lhconfort.com.ar')
5
5
  @access_token = args[:access_token]
6
6
  end
7
7
 
8
8
  def self.get_background_job(code)
9
- Model::BackgroundJob.new(get_request("/background_jobs/#{code}")[:body])
9
+ Model::BackgroundJob.new(get_request("/api/background_jobs/#{code}")[:body])
10
10
  end
11
11
 
12
12
  def self.update_background_job(code, params)
13
- Model::BackgroundJob.new(put_request("/background_jobs/#{code}", params)[:body])
13
+ Model::BackgroundJob.new(put_request("/api/background_jobs/#{code}", params)[:body])
14
14
  end
15
15
 
16
16
  def self.add_background_job_event(code, event_description)
17
17
  params = { description: event_description }
18
- Model::JobEvent.new(post_request("/background_jobs/#{code}/job_events", params)[:body])
18
+ Model::JobEvent.new(post_request("/api/background_jobs/#{code}/job_events", params)[:body])
19
19
  end
20
20
 
21
21
  def self.get_price_lists(filters={})
22
- get_request('/price_lists')[:body].map { |r| Model::PriceList.new(r) }
22
+ get_request('/api/price_lists')[:body].map { |r| Model::PriceList.new(r) }
23
23
  end
24
24
 
25
25
  def self.get_products(filters={})
26
- response = get_request('/products', filters)
26
+ response = get_request('/api/products', filters)
27
27
 
28
28
  if response[:headers][:link]
29
29
  {
@@ -36,11 +36,11 @@ module Xsys
36
36
  end
37
37
 
38
38
  def self.get_product(product_code)
39
- Model::Product.new(get_request("/products/#{product_code}")[:body])
39
+ Model::Product.new(get_request("/api/products/#{product_code}")[:body])
40
40
  end
41
41
 
42
42
  def self.get_product_providers(filters={})
43
- response = get_request('/product_providers', filters)
43
+ response = get_request('/api/product_providers', filters)
44
44
 
45
45
  if response[:headers][:link]
46
46
  {
@@ -53,11 +53,11 @@ module Xsys
53
53
  end
54
54
 
55
55
  def self.get_product_provider(provider_code)
56
- Model::ProductProvider.new(get_request("/product_providers/#{provider_code}")[:body])
56
+ Model::ProductProvider.new(get_request("/api/product_providers/#{provider_code}")[:body])
57
57
  end
58
58
 
59
59
  def self.get_product_categories(filters={})
60
- response = get_request('/product_categories', filters)
60
+ response = get_request('/api/product_categories', filters)
61
61
 
62
62
  if response[:headers][:link]
63
63
  {
@@ -70,11 +70,11 @@ module Xsys
70
70
  end
71
71
 
72
72
  def self.get_product_category(category_code)
73
- Model::ProductCategory.new(get_request("/product_categories/#{category_code}")[:body])
73
+ Model::ProductCategory.new(get_request("/api/product_categories/#{category_code}")[:body])
74
74
  end
75
75
 
76
76
  def self.get_product_price_lists(filters={})
77
- response = get_request('/product_price_lists', filters)
77
+ response = get_request('/api/product_price_lists', filters)
78
78
 
79
79
  if response[:headers][:link]
80
80
  {
@@ -87,23 +87,23 @@ module Xsys
87
87
  end
88
88
 
89
89
  def self.get_sellers
90
- get_request('/sellers')[:body].map { |r| Model::Seller.new(r) }
90
+ get_request('/api/sellers')[:body].map { |r| Model::Seller.new(r) }
91
91
  end
92
92
 
93
93
  def self.get_shops(kind=nil)
94
94
  shop_kinds = [:commercial, :virtual, :physical, :stockable, :service, :with_target]
95
95
 
96
96
  if kind.nil?
97
- get_request('/shops')[:body].map { |r| Model::Shop.new(r) }
97
+ get_request('/api/shops')[:body].map { |r| Model::Shop.new(r) }
98
98
  elsif shop_kinds.include?(kind.to_sym)
99
- get_request("/shops/#{kind}")[:body].map { |r| Model::Shop.new(r) }
99
+ get_request("/api/shops/#{kind}")[:body].map { |r| Model::Shop.new(r) }
100
100
  else
101
101
  []
102
102
  end
103
103
  end
104
104
 
105
105
  def self.get_users
106
- get_request('/users')[:body].map { |r| Model::User.new(r) }
106
+ get_request('/api/users')[:body].map { |r| Model::User.new(r) }
107
107
  end
108
108
 
109
109
  private
data/lib/xsys/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Xsys
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xsys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matias Hick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-24 00:00:00.000000000 Z
11
+ date: 2014-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler