megam_api 1.8.12 → 1.8.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/megam/api/balances.rb +1 -2
- data/lib/megam/api/version.rb +1 -1
- data/lib/megam/core/balances.rb +2 -14
- data/lib/megam/core/json_compat.rb +2 -2
- data/test/test_helper.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fac845f083780ffc6fc2d404c2b5946978d081f9
|
4
|
+
data.tar.gz: 3202e465d35b4a123d0cc64ca789a5b9e5b465a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5478f6efeb133f64248ec4fc3463e4e68fdb353670d14c5b59e41feb7c16d2b4b0ce283fbb8cdf254fe1190b7fc68bda77416b99325957ef8f1e49915108853
|
7
|
+
data.tar.gz: 399d56228440cc269e06359c4302f66c6c93e41e45d1ff38d16fc1f6cc911a17168a28497a504b3ba2074586c41f12934d03a8057bfd2f77fc5f6c5b2ab7f598
|
data/lib/megam/api/balances.rb
CHANGED
@@ -11,8 +11,7 @@ module Megam
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def get_balance(id)
|
14
|
-
@options = {:path => "/balances/#{id}",:body =>
|
15
|
-
|
14
|
+
@options = {:path => "/balances/#{id}",:body => Megam::JSONCompat.to_json(id)}.merge(@options)
|
16
15
|
request(
|
17
16
|
:expects => 200,
|
18
17
|
:method => :get,
|
data/lib/megam/api/version.rb
CHANGED
data/lib/megam/core/balances.rb
CHANGED
@@ -3,7 +3,6 @@ module Megam
|
|
3
3
|
def initialize(o)
|
4
4
|
@id = nil
|
5
5
|
@accounts_id = nil
|
6
|
-
@name = nil
|
7
6
|
@credit = nil
|
8
7
|
@created_at = nil
|
9
8
|
@updated_at = nil
|
@@ -31,13 +30,6 @@ module Megam
|
|
31
30
|
end
|
32
31
|
end
|
33
32
|
|
34
|
-
def name(arg=nil)
|
35
|
-
if arg != nil
|
36
|
-
@name = arg
|
37
|
-
else
|
38
|
-
@name
|
39
|
-
end
|
40
|
-
end
|
41
33
|
|
42
34
|
def credit(arg=nil)
|
43
35
|
if arg != nil
|
@@ -81,7 +73,6 @@ module Megam
|
|
81
73
|
index_hash["json_claz"] = self.class.name
|
82
74
|
index_hash["id"] = id
|
83
75
|
index_hash["accounts_id"] = accounts_id
|
84
|
-
index_hash["name"] = name
|
85
76
|
index_hash["credit"] = credit
|
86
77
|
index_hash["created_at"] = created_at
|
87
78
|
index_hash["updated_at"] = updated_at
|
@@ -98,7 +89,6 @@ module Megam
|
|
98
89
|
result = {
|
99
90
|
"id" => id,
|
100
91
|
"accounts_id" => accounts_id,
|
101
|
-
"name" => name,
|
102
92
|
"credit" => credit,
|
103
93
|
"created_at" => created_at,
|
104
94
|
"updated_at" => updated_at
|
@@ -110,7 +100,6 @@ module Megam
|
|
110
100
|
balances = new({})
|
111
101
|
balances.id(o["id"]) if o.has_key?("id")
|
112
102
|
balances.accounts_id(o["accounts_id"]) if o.has_key?("accounts_id")
|
113
|
-
balances.name(o["name"]) if o.has_key?("name")
|
114
103
|
balances.credit(o["credit"]) if o.has_key?("credit")
|
115
104
|
balances.created_at(o["created_at"]) if o.has_key?("created_at")
|
116
105
|
balances.updated_at(o["updated_at"]) if o.has_key?("updated_at")
|
@@ -131,7 +120,6 @@ module Megam
|
|
131
120
|
def from_hash(o)
|
132
121
|
@id = o[:id] if o.has_key?(:id)
|
133
122
|
@accounts_id = o[:accounts_id] if o.has_key?(:accounts_id)
|
134
|
-
@name = o[:name] if o.has_key?(:name)
|
135
123
|
@credit = o[:credit] if o.has_key?(:credit)
|
136
124
|
@created_at = o[:created_at] if o.has_key?(:created_at)
|
137
125
|
@updated_at = o[:updated_at] if o.has_key?(:updated_at)
|
@@ -152,14 +140,14 @@ module Megam
|
|
152
140
|
# returns a BalanceCollection
|
153
141
|
# don't return self. check if the Megam::BalanceCollection is returned.
|
154
142
|
def self.list(params)
|
155
|
-
balance = self.new(params
|
143
|
+
balance = self.new(params)
|
156
144
|
balance.megam_rest.get_balances
|
157
145
|
end
|
158
146
|
|
159
147
|
# Show a particular balance by name,
|
160
148
|
# Megam::Balance
|
161
149
|
def self.show(params)
|
162
|
-
pre = self.new(params
|
150
|
+
pre = self.new(params)
|
163
151
|
pre.megam_rest.get_balance(params["email"])
|
164
152
|
end
|
165
153
|
|
@@ -21,8 +21,8 @@ module Megam
|
|
21
21
|
MEGAM_BALANCESCOLLECTION = 'Megam::BalancesCollection'.freeze
|
22
22
|
MEGAM_BILLEDHISTORIES = 'Megam::Billedhistories'.freeze
|
23
23
|
MEGAM_BILLEDHISTORIESCOLLECTION = 'Megam::BilledhistoriesCollection'.freeze
|
24
|
-
MEGAM_BILLINGTRANSACTIONS = 'Megam::
|
25
|
-
MEGAM_BILLINGTRANSACTIONSCOLLECTION = 'Megam::
|
24
|
+
MEGAM_BILLINGTRANSACTIONS = 'Megam::BillingTransactions'.freeze
|
25
|
+
MEGAM_BILLINGTRANSACTIONSCOLLECTION = 'Megam::BillingTransactionsCollection'.freeze
|
26
26
|
MEGAM_COMPONENTS = 'Megam::Components'.freeze
|
27
27
|
MEGAM_COMPONENTSCOLLECTION = 'Megam::ComponentsCollection'.freeze
|
28
28
|
MEGAM_DOMAIN = 'Megam::Domains'.freeze
|
data/test/test_helper.rb
CHANGED
@@ -31,7 +31,7 @@ end
|
|
31
31
|
def megams(options={})
|
32
32
|
s_options = SANDBOX_HOST_OPTIONS.merge({
|
33
33
|
:email => "rajeshr@megam.io",
|
34
|
-
:api_key => "
|
34
|
+
:api_key => "e6c0a7f564c498b2621393957c85394dc01eb779",
|
35
35
|
:org_id => "ORG123",
|
36
36
|
#:password => "bWVnYW0="
|
37
37
|
})
|
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.
|
4
|
+
version: 1.8.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rajthilak, Kishorekumar Neelamegam, Ranjitha R, Vinodhini V, Rathish VBR, Rajesh
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-11-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: excon
|