drone_view_api 0.1.3 → 0.1.6

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