megam_api 1.8.12 → 1.8.13

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
  SHA1:
3
- metadata.gz: daf46476adb02af8e0cc3f93704cb33cb25c46d0
4
- data.tar.gz: eeed640b4382130111658aae22a8f7903b935a87
3
+ metadata.gz: fac845f083780ffc6fc2d404c2b5946978d081f9
4
+ data.tar.gz: 3202e465d35b4a123d0cc64ca789a5b9e5b465a3
5
5
  SHA512:
6
- metadata.gz: 48de42573abbf43b2d69a76782efb0cb6270c813f27245abeb8e94d90f78cb5a43b9960ed96b1a4c32be53efc9975b20e7d0c568975de66e54e4beb337f6438e
7
- data.tar.gz: b317cd8158acda180458fe7651a8021f541207ae907cd1506e9c670706bf0bc44d522035706aa54fa37d51c9bf44bda59f09c5ca2654bb97b2ccaf71232a8d9b
6
+ metadata.gz: a5478f6efeb133f64248ec4fc3463e4e68fdb353670d14c5b59e41feb7c16d2b4b0ce283fbb8cdf254fe1190b7fc68bda77416b99325957ef8f1e49915108853
7
+ data.tar.gz: 399d56228440cc269e06359c4302f66c6c93e41e45d1ff38d16fc1f6cc911a17168a28497a504b3ba2074586c41f12934d03a8057bfd2f77fc5f6c5b2ab7f598
@@ -11,8 +11,7 @@ module Megam
11
11
  end
12
12
 
13
13
  def get_balance(id)
14
- @options = {:path => "/balances/#{id}",:body => ""}.merge(@options)
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,
@@ -1,5 +1,5 @@
1
1
  module Megam
2
2
  class API
3
- VERSION = "1.8.12"
3
+ VERSION = "1.8.13"
4
4
  end
5
5
  end
@@ -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["email"], params["api_key"], params["host"])
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["email"], params["api_key"], params["host"])
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::Billingtransactions'.freeze
25
- MEGAM_BILLINGTRANSACTIONSCOLLECTION = 'Megam::BillingtransactionsCollection'.freeze
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 => "a0cf83e360845f2639db63e515c94ad35a94cd50",
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.12
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-10-18 00:00:00.000000000 Z
12
+ date: 2016-11-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: excon