drone_view_api 0.1.3 → 0.1.4

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: 98f62ba454e84316969d04ae0853bf477acb1587c76f62f7f74144fa8a025d73
4
- data.tar.gz: 190649ed482a37433f9e2b723ea51e552e308f9f5d007d82007adad42f97f046
3
+ metadata.gz: 27407d251bcaefeda71580e96e4de326c34c517381366a127a76be9be531a90d
4
+ data.tar.gz: 7a3da58293dd3e123017073d5aa77bf233e86d170029b186dae4b2b377d0d777
5
5
  SHA512:
6
- metadata.gz: 55bece19cc3a7710fbcb99fe888efdd1030d149acefd8e27859520a03e12fbf3410b6f468cc808937ac6c9a01ce39b6b08ebcf4a92d9bb693dff5f58fa752fe9
7
- data.tar.gz: 2a44042196beffbd943353136f5d11dcf5c1659385a906ac61d44a2658b9e49510651ebf68c3a9b215fedc356b2666ec0e54baf998e21e5f164e6806b1f506a3
6
+ metadata.gz: 3a6bae0b679f6038e593ded001e1c21d1a48097b672af6ef1816c58af5dbdcf21f6dfac8cad200ebc723184fd6539879107f0046317b6e13f0fd522080ecac5a
7
+ data.tar.gz: feec7594f7d0314f68d9db8836e697a00a9ac56655cc22ae443d8ebb9c7443c6113489b30f764b4aec5a5114146ddb77fc749137daa3316b5be810b9338d3fc1
Binary file
Binary file
@@ -0,0 +1,41 @@
1
+ class DroneApi::Inspections::Create < DroneApi::Base
2
+ Params = Struct.new(
3
+ :name,
4
+ :inspection_date,
5
+ :building,
6
+ keyword_init: true
7
+ )
8
+
9
+ def initialize params={}
10
+ super()
11
+ @params = Params.new(params)
12
+ end
13
+
14
+ def process_response response
15
+ @response_data = JSON.parse(response)
16
+ end
17
+
18
+ private
19
+
20
+ def validate
21
+ @errors['name'] << 'Can\'t be blank' if @params.name.to_s.empty?
22
+ end
23
+
24
+ def api_path
25
+ "/api/v2/inspections"
26
+ end
27
+
28
+ def request_type
29
+ 'POST'
30
+ end
31
+
32
+ def payload
33
+ {
34
+ inspection: {
35
+ name: @params.email,
36
+ inspection_date: @params.inspection_date,
37
+ building: @params.building
38
+ }
39
+ }
40
+ end
41
+ end
@@ -0,0 +1,5 @@
1
+ module DroneApi::Inspections
2
+
3
+ end
4
+
5
+ require 'drone_api/inspections/create'
@@ -1,3 +1,3 @@
1
1
  module DroneApi
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drone_view_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - saurabh gulati
@@ -47,6 +47,8 @@ files:
47
47
  - bin/console
48
48
  - bin/setup
49
49
  - drone_api.gemspec
50
+ - drone_view_api-0.1.2.gem
51
+ - drone_view_api-0.1.3.gem
50
52
  - lib/drone_api.rb
51
53
  - lib/drone_api/accounts.rb
52
54
  - lib/drone_api/accounts/create.rb
@@ -58,6 +60,8 @@ files:
58
60
  - lib/drone_api/clients.rb
59
61
  - lib/drone_api/clients/create.rb
60
62
  - lib/drone_api/clients/show.rb
63
+ - lib/drone_api/inspections.rb
64
+ - lib/drone_api/inspections/create.rb
61
65
  - lib/drone_api/version.rb
62
66
  homepage: http://app.droneviewpro.com
63
67
  licenses: