auth-lh 0.5.0 → 0.6.0

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: 4050ced5d2d0380668c2c5e333d4f38dc61d34ff
4
- data.tar.gz: a7c4b2ec6cb0f3a907c6fbf365918e5ee99375f3
3
+ metadata.gz: 1b0cc0bb9068688a7e6dece42b7876c0b5d3c07c
4
+ data.tar.gz: 7be6e37a78c37e5f197584e7b07d720bd294df2f
5
5
  SHA512:
6
- metadata.gz: 079cf55caa3701fcdb897594cebae2ee680b6cc69aaca00ff38ed038bf3dfaf7a0a5211127e0a5ee5a68cab426625caa64f151bd0f1462a2637f04e548a0ffca
7
- data.tar.gz: cdf4fdec8c4431876ea658b7ed61bb5a0211577106504ca3bf543ed222321e8b9725069fe0132ad15b75af89131da2be32d57d8008670feaeb0f9217afc8a50e
6
+ metadata.gz: d6c9da94b3687277a5b09e5739f03696185588b4f56681bf1195c93bd07d5b1ce5703ca05c7ce9d555049788c0d508cd9baf48883ead83496094419a4372ca17
7
+ data.tar.gz: b28d99fc63a3968d1a33b73737b5e54405eb606132a6f7aebb73e2a9132e3c595535432e3b97d31d99038ebae9e8f623a8c5f39d5424d071796d2b1ea54778a1
data/CHANGELOG.md CHANGED
@@ -101,3 +101,7 @@
101
101
  ## v0.5.0
102
102
 
103
103
  * Added shop_id to user
104
+
105
+ ## v0.6.0
106
+
107
+ * Changed get current shop return type
@@ -1,5 +1,5 @@
1
1
  module Auth
2
2
  module Lh
3
- VERSION = "0.5.0"
3
+ VERSION = "0.6.0"
4
4
  end
5
5
  end
data/lib/auth/lh.rb CHANGED
@@ -3,6 +3,7 @@ require 'auth_lh/authentication'
3
3
  require 'auth_lh/external_app'
4
4
  require 'auth_lh/role'
5
5
  require 'auth_lh/session_response'
6
+ require 'auth_lh/shop'
6
7
  require 'auth_lh/user'
7
8
  require 'auth_lh/user_extended'
8
9
 
@@ -0,0 +1,12 @@
1
+ module AuthLh
2
+ class Shop
3
+ attr_accessor :id, :code, :name, :stock_description
4
+
5
+ def initialize(attributes={})
6
+ attributes.each do |k,v|
7
+ self.send("#{k}=", v)
8
+ end
9
+ end
10
+ end
11
+ end
12
+
data/lib/auth_lh.rb CHANGED
@@ -46,7 +46,8 @@ module AuthLh
46
46
 
47
47
  def self.get_current_shop(ip_address=nil)
48
48
  attrs = { ip: ip_address }
49
- get_request('/api/whatsmyshop', attrs)['shop_codes']
49
+ response = get_request('/api/current_shop', attrs)
50
+ response.nil? ? nil : Shop.new(response)
50
51
  end
51
52
 
52
53
  def self.login_url(return_url=nil)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auth-lh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matias Hick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-24 00:00:00.000000000 Z
11
+ date: 2015-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -68,6 +68,7 @@ files:
68
68
  - lib/auth_lh/external_app.rb
69
69
  - lib/auth_lh/role.rb
70
70
  - lib/auth_lh/session_response.rb
71
+ - lib/auth_lh/shop.rb
71
72
  - lib/auth_lh/user.rb
72
73
  - lib/auth_lh/user_extended.rb
73
74
  - lib/auth_lh.rb