tito 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: 951e7497f3bb75bb4935545973a726aea1177571
4
- data.tar.gz: 50397ffa8134c5c8c889a35a13e8051d35637122
3
+ metadata.gz: fcd1647933c5f7b71e9ec5601a7b024d4f5c4f66
4
+ data.tar.gz: 67d94877e346e7949653d82ebb85e4f4b07f11e3
5
5
  SHA512:
6
- metadata.gz: 527f25419a39e196d6d024c305618c81b8c671a90c0b2bb22d21ad1c6e908b7a5ca3801689ff02d649c9ef5f6be9020dd9e25649ae6a8ebf277ca1f70985766f
7
- data.tar.gz: f574c42b120e03130c46f06088cec30014303d470d59bcce81256f87a9eb1807801b8acacf33cc469d009c2a12955437d10abd47cfec2ad0484dbe21467c1be1
6
+ metadata.gz: cd36d87b6ec13a7795f36a1b686f0b1b3f73bb1a493c9880d504726cbc9b25c4242e787c1dd4b12abb911b0eda83a3b5d93583cb2556f45a14a63e4def18743b
7
+ data.tar.gz: 07ebb10e1ef22b8262817e167eb889757a42eda88dbb28039974d8a5d1a3d10f8dcc79245213d178a787072193ba48ac210c6095080aa6e8acf34e0a86b7c562
data/lib/tito/base.rb CHANGED
@@ -58,13 +58,18 @@ module Tito
58
58
  @resource_path ||= "#{resource_name}s"
59
59
  end
60
60
 
61
- def self.get_url(path)
62
- [Tito::Base.site, path].join("/")
61
+ def self.get_path(path, path_prefix: nil)
62
+ [path_prefix, self.resource_path, path].compact.join("/")
63
+ end
64
+
65
+ def self.get_url(path, path_prefix: nil)
66
+ [Tito::Base.site, get_path(path, path_prefix: path_prefix)].join("/")
63
67
  end
64
68
 
65
69
  def self.get(path, params = {})
66
70
  api_key = params.delete(:api_key)
67
- new http(api_key: api_key).get(get_url(path), params: params, ssl_context: ssl_context).parse[resource_name]
71
+ path_prefix = params.delete(:path_prefix)
72
+ new http(api_key: api_key).get(get_url(path, path_prefix: path_prefix), params: params, ssl_context: ssl_context).parse[resource_name]
68
73
  end
69
74
 
70
75
  def self.all_path(path_prefix: nil)
data/lib/tito/event.rb CHANGED
@@ -3,6 +3,10 @@ module Tito
3
3
 
4
4
  extend Eventable::ClassMethods
5
5
 
6
+ def self.resource_path
7
+ nil
8
+ end
9
+
6
10
  def path
7
11
  "#{account_slug}/#{slug}"
8
12
  end
@@ -11,7 +11,7 @@ module Tito
11
11
  end
12
12
 
13
13
  def get(path, params = {})
14
- proxy_class.get(path, params.merge(api_key: api_key))
14
+ proxy_class.get(path, params.merge(path_prefix: proxy_path, api_key: api_key))
15
15
  end
16
16
 
17
17
  def all
data/lib/tito/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tito
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: tito
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
  - Paul Campbell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-30 00:00:00.000000000 Z
11
+ date: 2017-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http