Class: InceApi::GetSimUsage

Inherits:
Object
  • Object
show all
Defined in:
lib/ince_api/get_sim_usage.rb

Instance Method Summary collapse

Constructor Details

#initialize(access_token:, iccid:, params: {}) ⇒ GetSimUsage

Returns a new instance of GetSimUsage.



3
4
5
6
7
# File 'lib/ince_api/get_sim_usage.rb', line 3

def initialize(access_token:, iccid:, params: {})
  @access_token = access_token
  @iccid = iccid
  @params = params
end

Instance Method Details

#sim_usageObject



9
10
11
12
13
14
15
16
# File 'lib/ince_api/get_sim_usage.rb', line 9

def sim_usage
  response = connection.request(request)
  if response.body != ''
    JSON.parse(response.body)
  else
    {'status_code' => 404, 'error_message' => 'SIM with ICCID not found'}
  end
end