megam_api 1.8.7 → 1.8.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02d2482daec0b4dd2d4fb4f323503eca81085dcf
4
- data.tar.gz: 7c8c06d82820074532de54b9282b8f93d6ed52a7
3
+ metadata.gz: 919a36834fe6294eae7980cdaf1dfc02effba90e
4
+ data.tar.gz: 3bace61750223469f20a6696274c40d7c12f42b6
5
5
  SHA512:
6
- metadata.gz: 6f353a3add0bf9411c5ecb34c225914629ac1710eef02498af85e4b821decd50ecc06d6002982c219b9de99dfa9d2527ebb18e25fe7d0184e64efdb8f8ce1fe8
7
- data.tar.gz: 156f6666cc9d27e6c7add544eaf83259c249e68d8560ffce7d58d50dfe45afff49c92110e5eb37acd2ee3a942a0ad92970c1668260e1c33bea7025fbf7dd9479
6
+ metadata.gz: 04a8f05a46ac3824ea625f408732addfabe6099fa538eb9c581ad69c61b5371c618cbf16bb952951bb4221eea53d68d5e2ee462604e63fc02521288ce15d47fa
7
+ data.tar.gz: 3c16718bac74093cbd606d74199524fb7ea60cac7c08f6967380fe6874765f5b0d24991df7f06febc838c3b19cc7653f253d8167ae1dc4c332eaf56412566bd8
@@ -1,17 +1,8 @@
1
1
  module Megam
2
2
  class API
3
- def get_licenses
4
- @options = {:path => '/license',:body => ""}.merge(@options)
5
3
 
6
- request(
7
- :expects => 200,
8
- :method => :get,
9
- :body => @options[:body]
10
- )
11
- end
12
-
13
- def get_license(license_name)
14
- @options = {:path => "/license/#{license_name}",:body => ""}.merge(@options)
4
+ def get_license(license_id)
5
+ @options = {:path => "/licenses/#{license_id}",:body => ""}.merge(@options)
15
6
 
16
7
  request(
17
8
  :expects => 200,
@@ -1,6 +1,6 @@
1
1
  module Megam
2
2
  class API
3
3
 
4
- VERSION = "1.8.7"
4
+ VERSION = "1.8.8"
5
5
  end
6
6
  end
@@ -1,7 +1,6 @@
1
1
  module Megam
2
2
  class License < Megam::RestAdapter
3
3
  def initialize(o)
4
- @org_id = nil
5
4
  @data = nil
6
5
  @some_msg = {}
7
6
  super(o)
@@ -11,16 +10,6 @@ module Megam
11
10
  self
12
11
  end
13
12
 
14
- def org_id(arg=nil)
15
- if arg != nil
16
- @org_id= arg
17
- else
18
- @org_id
19
- end
20
- end
21
-
22
-
23
-
24
13
 
25
14
  def data(arg=nil)
26
15
  if arg != nil
@@ -46,7 +35,6 @@ module Megam
46
35
  def to_hash
47
36
  index_hash = Hash.new
48
37
  index_hash["json_claz"] = self.class.name
49
- index_hash["org_id"] = org_id
50
38
  index_hash["data"] = data
51
39
  index_hash
52
40
  end
@@ -59,7 +47,6 @@ module Megam
59
47
 
60
48
  def for_json
61
49
  result = {
62
- "org_id" => org_id,
63
50
  "data" => data
64
51
  }
65
52
  result
@@ -68,7 +55,7 @@ module Megam
68
55
  #
69
56
  def self.json_create(o)
70
57
  license = new({})
71
- license.created_at(o["data"]) if o.has_key?("data")
58
+ license.data(o["results"]["data"]) if o["results"]
72
59
  #success or error
73
60
  license.some_msg[:code] = o["code"] if o.has_key?("code")
74
61
  license.some_msg[:msg_type] = o["msg_type"] if o.has_key?("msg_type")
@@ -84,7 +71,6 @@ module Megam
84
71
  end
85
72
 
86
73
  def from_hash(o)
87
- @org_id = o[:org_id] if o.has_key?(:org_id)
88
74
  @data = o[:data] if o.has_key?(:data)
89
75
  self
90
76
  end
@@ -99,19 +85,11 @@ module Megam
99
85
  megam_rest.post_license(to_hash)
100
86
  end
101
87
 
102
- # Load all license -
103
- # returns a LicensesCollection
104
- # don't return self. check if the Megam::LicenseCollection is returned.
105
- def self.list(params)
106
- license = self.new(params)
107
- license.megam_rest.get_license
108
- end
109
-
110
- # Show a particular License by name,
88
+ # Show a particular License by id,
111
89
  # Megam::License
112
90
  def self.show(params)
113
91
  pre = self.new(params)
114
- pre.megam_rest.get_license(params["name"])
92
+ pre.megam_rest.get_license(params["id"])
115
93
  end
116
94
 
117
95
  def to_s
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: megam_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.7
4
+ version: 1.8.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajthilak, Kishorekumar Neelamegam, Ranjitha R, Vinodhini V, Rathish VBR, Rajesh