Class: EasySMS::AccountResource

Inherits:
Struct
  • Object
show all
Defined in:
lib/easy_sms/account_resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#clientObject

Returns the value of attribute client

Returns:

  • (Object)

    the current value of client



2
3
4
# File 'lib/easy_sms/account_resource.rb', line 2

def client
  @client
end

Instance Method Details

#getObject



3
4
5
6
7
8
9
# File 'lib/easy_sms/account_resource.rb', line 3

def get
  res = client.get('', {})

  JSON.parse(res).tap do |json|
    json['c_at'] = Time.parse(json['c_at']) if json['c_at']
  end
end

#update(attrs = {}) ⇒ Object



11
12
13
14
15
# File 'lib/easy_sms/account_resource.rb', line 11

def update(attrs = {})
  res = client.put('', attrs)

  JSON.parse(res)
end