tito 0.2.1 → 0.2.2

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: 9aacc0e3bbfede95425d63f571de397b4523a099
4
- data.tar.gz: 6095ace328a2214db872bfb92ef1872eabf434d7
3
+ metadata.gz: 3486db93ff9a1566d1ec21840652f1eb6017dfc6
4
+ data.tar.gz: ba9e3c2b9eae3b78be7c305d95cee132499ac27c
5
5
  SHA512:
6
- metadata.gz: c000ed72f2a2a951784414a4350698f86414ef10d4eef3742f2ce493e4f71d311df23070ece39dbbbd7956385181df1b3f209127e994bb7ddd33e013f5823178
7
- data.tar.gz: ab3b33f56df73c87491d51392040da8a33795b97c3e884d03e2e09d481bc39ccc97ed6f8e77e8ccfb4e880816b96783145ac8e5a27ca4bd5d39c6f393c778edb
6
+ metadata.gz: 650e413c915d7df388fe421a2975c7fde313b574702e806f732ea31a97cdbf7e121ebd2bfc224462f7e7e942100aacb352d0b54d005d762d88d9c9cf71f81f2c
7
+ data.tar.gz: f9b8453fdaaee44818d1f8ae8bbf32527ef998a1cb816db804c25d845c859916d9fe61c5d6c1b421ccc461f2bfac56a3347e84d06ca485d9f88ca4aa81182192
@@ -31,7 +31,7 @@ module Tito
31
31
  end
32
32
 
33
33
  def self.http(api_key: nil)
34
- HTTP.auth(auth(api_key: nil)).accept("application/json")
34
+ HTTP.auth(auth(api_key: api_key)).accept("application/json")
35
35
  end
36
36
 
37
37
  def self.resource_path=(val)
@@ -1,6 +1,8 @@
1
1
  module Tito
2
2
  class Event < Base
3
3
 
4
+ extend Eventable::ClassMethods
5
+
4
6
  def path
5
7
  "#{account_slug}/#{slug}"
6
8
  end
@@ -13,14 +15,6 @@ module Tito
13
15
  "#{account_slug}/events"
14
16
  end
15
17
 
16
- def self.for_account(url)
17
- RequestProxy.new(proxy_class: self, proxy_path: url)
18
- end
19
-
20
- def self.[](url)
21
- self.for_account(url)
22
- end
23
-
24
18
  # property :title, type: :string
25
19
  # property :slug, type: :string
26
20
  # property :account_slug, type: :string
@@ -24,12 +24,12 @@ module Tito
24
24
  # end
25
25
 
26
26
  module ClassMethods
27
- def for_event(url)
28
- RequestProxy.new(proxy_class: self, proxy_path: url)
27
+ def for_event(url, options = {})
28
+ RequestProxy.new(proxy_class: self, proxy_path: url, api_key: options.delete(:api_key))
29
29
  end
30
30
 
31
- def [](url)
32
- self.for_event(url)
31
+ def [](url, options = {})
32
+ self.for_event(url, options)
33
33
  end
34
34
 
35
35
  # def event_id_from_params(params)
@@ -10,9 +10,8 @@ module Tito
10
10
  @api_key = api_key
11
11
  end
12
12
 
13
- def all(attrs = {})
14
- _api_key = attrs.delete(:api_key) || api_key
15
- proxy_class.all(path_prefix: proxy_path, api_key: _api_key)
13
+ def all
14
+ proxy_class.all(path_prefix: proxy_path, api_key: api_key)
16
15
  end
17
16
 
18
17
  def new(attrs = {})
@@ -1,3 +1,3 @@
1
1
  module Tito
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tito
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Campbell