adn_viewer 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/adn_viewer.rb +11 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f703f9b80a50bbca4bd05f9f6730cda7598d90a5
4
- data.tar.gz: 53ea579e1a4be5cb00e350f384acf777be50aabf
3
+ metadata.gz: 9e2bf07132997c4608a933efe44630de4bad6cce
4
+ data.tar.gz: 1d1d2dc75bbeaeefd29fdc23840658036685ed12
5
5
  SHA512:
6
- metadata.gz: babc8d0b25c4a097063babb7638e45ef5a10baf2723e485bc5dbf44a0c6cb1976822a9bdf3c7a195ae8bfd7c7ea1b3df51d1805e9ab957f870d28b2e14820f6e
7
- data.tar.gz: 1b2caaec06c035e297d09bec0dd9415fcc9643845bb74371e4fa88d965ff01d75602546d06ce9c8e2881c06e4e9b5e3ee109f5a812b87142cd92eb311a12aacc
6
+ metadata.gz: bc79f0256574ce1e3e3f93ab08de956035402ca538e8becd117934e6dc7b988245ec4fb99fe4bee5c82b4b9083f801d76de435036e4ab0bd30ffd1da32c8bb0f
7
+ data.tar.gz: 1211e7197a77f258797cc7f14593c60541459cdf897e4cd9b9cd2ecf672c86c12ec13d5985ec27d32ab5e6a792aa80d4fb2dc50fbbe6b9b4e033e6242d9009b1
data/lib/adn_viewer.rb CHANGED
@@ -39,4 +39,15 @@ class Adn_Viewer
39
39
  puts JSON.parse(http.request(request, file).read_body)
40
40
  end
41
41
 
42
+ def self.register(token, urn)
43
+ url = URI("https://developer.api.autodesk.com/viewingservice/v1/register")
44
+ http = Net::HTTP.new(url.host, url.port)
45
+ http.use_ssl = true
46
+ request = Net::HTTP::Post.new(url)
47
+ request["authorization"] = 'Bearer ' + token
48
+ request["content-type"] = 'application/json'
49
+ request.body = "{\n \"urn\": \"" + urn + "\"\n}"
50
+ JSON.parse(http.request(request).read_body)
51
+ end
52
+
42
53
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adn_viewer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pratham Makhni Alag