domoscio_admin 0.1.0 → 0.2.0

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
  SHA256:
3
- metadata.gz: a790c17d0b0a88271416a5f4a7fa5f2a06e4bb5b0a751b9d1e91483bc006d864
4
- data.tar.gz: bbd25ad9fb705fbea08d2e6099355c31e39c6cece6b3c07d0673d75f6887a422
3
+ metadata.gz: fa06e4ae7a619c9aff98963f81a181fd223caff8bfc2b918c9bae2f2c2d11547
4
+ data.tar.gz: 70f0295138008845cd776db1cd34a6e164436e5c41bddb7d78846e96f5736508
5
5
  SHA512:
6
- metadata.gz: a7f80348978cb8817f9b4bdbea72d96108226bd76090a2cf5181054f364ce010f1ef6fcc8e55c15f3c2f0601fd152e2717f8c674a7480abca0cb75e8296b3eee
7
- data.tar.gz: edf7e8648248865b3e5a96aa704f896ceb786b073aa906b507b7b92f0ab1a1a1d8124264a0bc537aedaa6804aa01af3a8f331fd85ca7abd2da0bacb91822b28b
6
+ metadata.gz: 3dc3c6d2116930d2b29df39fe51eebd225f74c3837b4707fb37ec6bd5c8b224bfd550df41f50ffabcab50899948509f6e32c3c31e13752d2620a1fc6aaa3ed8b
7
+ data.tar.gz: 33cf012a480e5fb6e9b48b5ace7deff1095c95c3be5ada2e0df6ddd141c386112e0005156f9297d3fd48635d15a1eebe36ef961857d332205d50e7d8aec03f18
@@ -1,5 +1,5 @@
1
1
  module DomoscioAdmin
2
- class InstanceParameter < Resource
2
+ class InstanceParameter < ResourceInstance
3
3
  include DomoscioAdmin::HTTPCalls::Fetch
4
4
  include DomoscioAdmin::HTTPCalls::Update
5
5
  end
@@ -0,0 +1,8 @@
1
+ module DomoscioAdmin
2
+ class InstanceUser < ResourceInstance
3
+ include DomoscioAdmin::HTTPCalls::Create
4
+ include DomoscioAdmin::HTTPCalls::Fetch
5
+ include DomoscioAdmin::HTTPCalls::Update
6
+ include DomoscioAdmin::HTTPCalls::Destroy
7
+ end
8
+ end
@@ -0,0 +1,9 @@
1
+ module DomoscioAdmin
2
+ class Resource
3
+ class << self
4
+ def class_name
5
+ name.split('::')[-1]
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,10 +1,6 @@
1
1
  module DomoscioAdmin
2
- class Resource
2
+ class ResourceInstance < Resource
3
3
  class << self
4
- def class_name
5
- name.split('::')[-1]
6
- end
7
-
8
4
  def url(id = nil)
9
5
  if self == Resource
10
6
  raise NotImplementedError.new('Resource is an abstract class. Do not use it directly.')
@@ -0,0 +1,15 @@
1
+ module DomoscioAdmin
2
+ class ResourceUser < Resource
3
+ class << self
4
+ def url(id = nil)
5
+ if self == Resource
6
+ raise NotImplementedError.new('Resource is an abstract class. Do not use it directly.')
7
+ end
8
+
9
+ build_url = "/users"
10
+ build_url << "/#{CGI.escape(id.to_s)}" if id
11
+ return build_url
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ module DomoscioAdmin
2
+ class User < ResourceUser
3
+ include DomoscioAdmin::HTTPCalls::Fetch
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module DomoscioAdmin
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -10,8 +10,12 @@ require 'domoscio_admin/authorization_token'
10
10
  require 'domoscio_admin/generators/install_generator'
11
11
  # resources
12
12
  require 'domoscio_admin/http_calls'
13
- require 'domoscio_admin/resource'
14
- require 'domoscio_admin/instance/instance_parameter'
13
+ require 'domoscio_admin/resources/resource'
14
+ require 'domoscio_admin/resources/resource_user'
15
+ require 'domoscio_admin/resources/resource_instance'
16
+ require 'domoscio_admin/resources/instances/instance_parameter'
17
+ require 'domoscio_admin/resources/instances/instance_user'
18
+ require 'domoscio_admin/resources/users/user'
15
19
 
16
20
  module DomoscioAdmin
17
21
  class Configuration
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: domoscio_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pascal Lim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-08 00:00:00.000000000 Z
11
+ date: 2022-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -40,9 +40,13 @@ files:
40
40
  - lib/domoscio_admin/generators/install_generator.rb
41
41
  - lib/domoscio_admin/generators/templates/install.rb
42
42
  - lib/domoscio_admin/http_calls.rb
43
- - lib/domoscio_admin/instance/instance_parameter.rb
44
43
  - lib/domoscio_admin/json.rb
45
- - lib/domoscio_admin/resource.rb
44
+ - lib/domoscio_admin/resources/instances/instance_parameter.rb
45
+ - lib/domoscio_admin/resources/instances/instance_user.rb
46
+ - lib/domoscio_admin/resources/resource.rb
47
+ - lib/domoscio_admin/resources/resource_instance.rb
48
+ - lib/domoscio_admin/resources/resource_user.rb
49
+ - lib/domoscio_admin/resources/users/user.rb
46
50
  - lib/domoscio_admin/version.rb
47
51
  - spec/spec_helper.rb
48
52
  homepage: https://www.domoscio.com