packethost 0.0.2 → 0.0.3

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: 50086358783c764e20bda681513dd8d5a906ade1
4
- data.tar.gz: 59f13c5ce921a4c162cb3a7b97bd6d7a760d1e0b
3
+ metadata.gz: 8c98c2bd2f24e9a66aedcbb98fdbabd543cea562
4
+ data.tar.gz: 4ce409f660fe4bc486051aafff5cedd42da3d9e5
5
5
  SHA512:
6
- metadata.gz: ec7e52edbf3310f5c9a46ee046afac555fb247e3de9ca625f03186ff1d94fd6dfc6fbf63b87515596b8dd06a8d467ddba21fce0da943ba00441815ce5dffab36
7
- data.tar.gz: 01551f98c15e88ed7ed3aa6a77406fd8184ac42c826074ea97a359afd555bcc6e16f222bae3a3fc692c572cbf95ed153151a02aef3d8b6845412c2d8617b153f
6
+ metadata.gz: 42987ca54bc9eb6f88c87b025a88ebb4126741bfef9b452b6e341f61bb1b45bffbd2ea187892f745aa43a17ff02f258abaf9409d6a0453e9e761755fdeef8448
7
+ data.tar.gz: c1141b24edc4e608c126e7822843c8bb085d6e5185dc1cc80ca91f920b03e83e906238dad99df0540d9d6347fa66b78c46da3c62ac2358ed1053c780bba28858
data/lib/packet.rb CHANGED
@@ -25,19 +25,21 @@ module Packet
25
25
  @client ||= Packet::Client.new
26
26
  end
27
27
 
28
- private
29
-
30
28
  def self.reset_client!
31
29
  @client = nil
32
30
  end
31
+ private_class_method :reset_client!
33
32
 
34
- def self.respond_to_missing?(method_name, include_private = false)
35
- client.respond_to?(method_name, include_private)
36
- end if RUBY_VERSION >= '1.9'
37
-
38
- def self.respond_to?(method_name, include_private = false)
39
- client.respond_to?(method_name, include_private) || super
40
- end if RUBY_VERSION < '1.9'
33
+ if RUBY_VERSION >= '1.9'
34
+ def self.respond_to_missing?(method_name, include_private = false)
35
+ client.respond_to?(method_name, include_private)
36
+ end
37
+ private_class_method :respond_to_missing?
38
+ else
39
+ def self.respond_to?(method_name, include_private = false)
40
+ client.respond_to?(method_name, include_private) || super
41
+ end
42
+ end
41
43
 
42
44
  def self.method_missing(method_name, *args, &block)
43
45
  if client.respond_to?(method_name)
@@ -46,4 +48,5 @@ module Packet
46
48
  super
47
49
  end
48
50
  end
51
+ private_class_method :method_missing
49
52
  end
data/lib/packet/client.rb CHANGED
@@ -56,7 +56,7 @@ module Packet
56
56
  when 404 then NotFound
57
57
  else Error
58
58
  end
59
- fail klass, response.body
59
+ raise klass, response.body
60
60
  end
61
61
 
62
62
  include Packet::Client::Devices
@@ -12,7 +12,8 @@ module Packet
12
12
  class_attribute :_casts
13
13
  self._casts = {}
14
14
 
15
- attr_accessor :client, :id
15
+ attr_accessor :id
16
+ attr_writer :client
16
17
  delegate :resource_name, to: :class
17
18
  end
18
19
 
@@ -10,7 +10,7 @@ module Packet
10
10
  [ivar.to_s.tr('@', ''), instance_variable_get(ivar)]
11
11
  end.to_h
12
12
  end
13
- alias_method :to_h, :to_hash
13
+ alias to_h to_hash
14
14
  end
15
15
  end
16
16
  end
@@ -1,3 +1,3 @@
1
1
  module Packet
2
- VERSION = '0.0.2'.freeze
2
+ VERSION = '0.0.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: packethost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Bell