alucma 1.0.4 → 1.0.5

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/alucma.rb +4 -0
  3. data/lib/alucma/client.rb +2 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2428ca957935488b539453cc903f87b13e348e3b
4
- data.tar.gz: 62b1ad3ef3dd6dd63ffce2f2d3a1e5f4d0ab5d6a
3
+ metadata.gz: e7b44cfa406231af424b0cb6512ff09a95b7d787
4
+ data.tar.gz: 6474c3354a9de8602ad4ff16f980b4ee41c39674
5
5
  SHA512:
6
- metadata.gz: 285a07c0c697b0c9a0643a035ca0465b724779018ef5c2b2c6d6dec7ac665e2a5d45bb3694201bbb91976891a076d5846681dc80731877cbd680c10a94e3853b
7
- data.tar.gz: 88a4632e02266ac9f1ce5032234305098e33771c39bf6f38fe65a7008f72bd44e3ce6e1e13c50f32925aa57ee217f2d6206b210119e20fbd8d81673d7af4191b
6
+ metadata.gz: 145fcc99c3b3953410061cf412682ff9ddb6f40788afd6f74cb30d565d088a9b56473bf7e6c5aaffded9a7bf268a08b9b753a9ff84a8dbc5844c2c20d210df34
7
+ data.tar.gz: ab160844e6992c16780691c4ffdfbe039232215d89aa418d4b15df89d758e3841ed60082fc37dfe6917b1ace9c38d87bde36511dd418c2ddb1b4a2a47e3d70b3
@@ -9,6 +9,10 @@ class ALUCMA
9
9
  return { :error => "Invalid input. Input must be a hash." }
10
10
  end
11
11
 
12
+ if hash[:access_token]
13
+ return Client.new(hash)
14
+ end
15
+
12
16
  if !hash[:client_id] || !hash[:client_secret]
13
17
  return { :error => "Missing parameters. Must Client ID and Client Secret" }
14
18
  end
@@ -2,8 +2,9 @@ class Client
2
2
  attr_accessor :headers
3
3
 
4
4
  def initialize(args={})
5
+ access_token = args["access_token"] || args[:access_token]
5
6
  self.headers = {
6
- "Authorization" => "Bearer #{args["access_token"]}",
7
+ "Authorization" => "Bearer #{access_token}",
7
8
  "Content-Type" => "application/json"
8
9
  }
9
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alucma
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pulak Khurana (Nick)