helium-ruby 0.15.0 → 0.16.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: 53e05f57ef55311d33284991d8d4025a41f4e7b4
4
- data.tar.gz: 4180c6aa50f17b1738a23ec6706a56f3a8c175a3
3
+ metadata.gz: 0eed59513eb33f3f129f9cba51fb02fcc6bd97db
4
+ data.tar.gz: a4538235aae9daaad2fc0638aa14ffdf9e5e701d
5
5
  SHA512:
6
- metadata.gz: 019483fd957599d0ad237019568d3369c5dd85b26d6a38e0edfd4af9252e61ca1b7aba1530b35e5becc1b6792e462b019022094591c00d02b1e36fa9629d6815
7
- data.tar.gz: 1ff63065a3b9113f3a5a9950229669301dd5435a94dd974c0ecbae0849ed5d29f58c7ebbc89105e3784a25d8bae1ea44670d267515a542968becb4bf5f00701a
6
+ metadata.gz: 0fa1c5f2581b813d6a62402fe8949be94a9644a80f728beba923b3b2cf28efd9ca5f2de589e12d380c43dae778c77480ef5a66c628e3d70287d0d2138375e0a0
7
+ data.tar.gz: 2d5559f31298fd6c550a7d0d0a0ded5abdeb4b5295fa88cbc54543377493287cfc59aaeb6315f87e29bda9f488727c5144ace1fcea207c780ffa773f525a1ab5
@@ -9,6 +9,10 @@ module Helium
9
9
  @timezone = @params.dig('attributes', 'timezone')
10
10
  end
11
11
 
12
+ def resource_path
13
+ "/organization"
14
+ end
15
+
12
16
  # TODO refactor into relationships
13
17
  def users
14
18
  @client.organization_users
@@ -80,12 +80,17 @@ module Helium
80
80
  end
81
81
  end # << self
82
82
 
83
+ # Returns a path identifying the current resource. Can be overridden
84
+ # in child classes to handle non-standard resources (e.g. Organization)
85
+ # @return [String] path to resource
86
+ def resource_path
87
+ "/#{resource_name}/#{self.id}"
88
+ end
89
+
83
90
  # Updates a Resource
84
91
  # @param attributes [Hash] The attributes to update
85
92
  # @return [Resource] The updated resource
86
93
  def update(attributes)
87
- path = "/#{resource_name}/#{self.id}"
88
-
89
94
  body = {
90
95
  data: {
91
96
  attributes: attributes,
@@ -94,7 +99,7 @@ module Helium
94
99
  }
95
100
  }
96
101
 
97
- response = @client.patch(path, body: body)
102
+ response = @client.patch(resource_path, body: body)
98
103
  resource_data = JSON.parse(response.body)["data"]
99
104
 
100
105
  return self.class.new(client: self, params: resource_data)
@@ -1,3 +1,3 @@
1
1
  module Helium
2
- VERSION = "0.15.0"
2
+ VERSION = "0.16.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: helium-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Allen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-10-26 00:00:00.000000000 Z
12
+ date: 2016-11-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: typhoeus