insales_api 0.1.0 → 0.1.1

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: 0874e0c3d9d031bd7c44623652e9f8d0118bbca1
4
- data.tar.gz: d8f445c2fd2f722d03368b0cef92430f4bb338b4
3
+ metadata.gz: 1b059c0e53db8c1515b0f80fdd4f6a3b8d8540fa
4
+ data.tar.gz: b51b151c44b1e340c8a88043ae09cfa1ccf44c28
5
5
  SHA512:
6
- metadata.gz: 106dfba38c2704be7e63243f6493d441d440a200dc9f6a39454e21ea40c765cf16d5859f8103f5305786445ced8a42014603dbd1a43c56dc67adf8bea23bdc82
7
- data.tar.gz: de95a094d63c5e09583943e56296f3d66f2a91e37246538afb499e7aae6252a832044acb8eaf74fa16a9c97dd163752bf5862c050af4dad5bc37ec03e1b9d5ed
6
+ metadata.gz: e283d1aa7c0a1d311615566d30bf3319c9553d90ce1d2b44ed56950917d694ed980689fb24973e2747547a7c3160a4ad2a46172a62fe485bc5e34a1a522df419
7
+ data.tar.gz: 150b0dc5f8f81a3f822a03752aadd189f296e35778276c6866bd7f4ff8e75c70922a0c2f8b92c274bd8d9ba83bcb9ae2e480a2b10c9f8acc535a1d3ae267f897
@@ -32,6 +32,7 @@ module InsalesApi
32
32
  autoload :File
33
33
  autoload :Image
34
34
  autoload :JsTag
35
+ autoload :Notification
35
36
  autoload :OptionName
36
37
  autoload :OptionValue
37
38
  autoload :Order
@@ -42,8 +43,10 @@ module InsalesApi
42
43
  autoload :ProductField
43
44
  autoload :ProductFieldValue
44
45
  autoload :Property
46
+ autoload :Characteristic
45
47
  autoload :RecurringApplicationCharge
46
48
  autoload :Theme
49
+ autoload :User
47
50
  autoload :Variant
48
51
  autoload :Webhook
49
52
  end
@@ -2,7 +2,6 @@ module InsalesApi
2
2
  class ActiveResourceProxy
3
3
  class << self
4
4
  def need_proxy?(value)
5
- return true if value.is_a?(Hash) || value.is_a?(Array)
6
5
  klass = value.is_a?(Class) ? value : value.class
7
6
  return true if klass < Base || klass <= ActiveResource::Collection
8
7
  false
@@ -14,8 +13,8 @@ module InsalesApi
14
13
  @subject = subject
15
14
  end
16
15
 
17
- def respond_to_missing?(method_name)
18
- @subject.respond_to?(method_name) || super
16
+ def respond_to_missing?(method_name, include_private)
17
+ @subject.respond_to?(method_name, include_private) || super
19
18
  end
20
19
 
21
20
  def method_missing(method_id, *args, &block)
@@ -57,8 +57,8 @@ module InsalesApi
57
57
  ).to_s
58
58
  end
59
59
 
60
- def auth_token
61
- @auth_token ||= InsalesApi::Password.create(password, salt)
60
+ def auth_token(salt = self.salt, user_email = '', user_name = '', user_id = '')
61
+ @auth_token ||= InsalesApi::Password.create(password, salt, user_email, user_name, user_id)
62
62
  end
63
63
 
64
64
  def salt
@@ -0,0 +1,5 @@
1
+ module InsalesApi
2
+ class Characteristic < Base
3
+ self.prefix = "#{prefix}properties/:property_id/"
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module InsalesApi
2
+ class Notification < Base; end
3
+ end
@@ -1,7 +1,7 @@
1
1
  module InsalesApi
2
2
  module Password
3
- def self.create(secret, token)
4
- Digest::MD5.hexdigest("#{token}#{secret}")
3
+ def self.create(secret, token, user_email = '', user_name = '', user_id = '')
4
+ Digest::MD5.hexdigest("#{token}#{user_email}#{user_name}#{user_id}#{secret}")
5
5
  end
6
6
  end
7
7
  end
@@ -1,3 +1,7 @@
1
1
  module InsalesApi
2
- class Property < Base; end
2
+ class Property < Base
3
+ def characteristics
4
+ InsalesApi::Characteristic.all(params: { property_id: id } )
5
+ end
6
+ end
3
7
  end
@@ -0,0 +1,3 @@
1
+ module InsalesApi
2
+ class User < Base; end
3
+ end
@@ -2,7 +2,7 @@ module InsalesApi
2
2
  module VERSION
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].compact.join('.')
8
8
  end
@@ -26,16 +26,6 @@ describe InsalesApi::ActiveResourceProxy do
26
26
  it { should be false }
27
27
  end
28
28
 
29
- context 'for array' do
30
- let(:object) { [] }
31
- it { should be true }
32
- end
33
-
34
- context 'for hash' do
35
- let(:object) { {} }
36
- it { should be true }
37
- end
38
-
39
29
  context 'for InsalesApi::Base class' do
40
30
  let(:object) { InsalesApi::Account }
41
31
  it { should be true }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: insales_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - InSales
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-06 00:00:00.000000000 Z
11
+ date: 2015-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -95,6 +95,7 @@ files:
95
95
  - lib/insales_api/asset.rb
96
96
  - lib/insales_api/base.rb
97
97
  - lib/insales_api/category.rb
98
+ - lib/insales_api/characteristic.rb
98
99
  - lib/insales_api/client.rb
99
100
  - lib/insales_api/client_group.rb
100
101
  - lib/insales_api/collect.rb
@@ -108,6 +109,7 @@ files:
108
109
  - lib/insales_api/helpers/init_api.rb
109
110
  - lib/insales_api/image.rb
110
111
  - lib/insales_api/js_tag.rb
112
+ - lib/insales_api/notification.rb
111
113
  - lib/insales_api/option_name.rb
112
114
  - lib/insales_api/option_value.rb
113
115
  - lib/insales_api/order.rb
@@ -124,6 +126,7 @@ files:
124
126
  - lib/insales_api/resource/paginated.rb
125
127
  - lib/insales_api/resource/with_updated_since.rb
126
128
  - lib/insales_api/theme.rb
129
+ - lib/insales_api/user.rb
127
130
  - lib/insales_api/variant.rb
128
131
  - lib/insales_api/version.rb
129
132
  - lib/insales_api/webhook.rb
@@ -150,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
153
  version: '0'
151
154
  requirements: []
152
155
  rubyforge_project: insales_api
153
- rubygems_version: 2.2.2
156
+ rubygems_version: 2.4.8
154
157
  signing_key:
155
158
  specification_version: 4
156
159
  summary: Gem for accessing the InSales REST web services