Class: Infobip::SmsApi::Base
- Inherits:
-
Object
- Object
- Infobip::SmsApi::Base
show all
- Defined in:
- lib/infobip/sms_api/model/base.rb
Instance Method Summary
collapse
Instance Method Details
#to_hash ⇒ Object
7
8
9
10
11
12
13
14
|
# File 'lib/infobip/sms_api/model/base.rb', line 7
def to_hash
hash = {}
self.instance_variables.each do |var|
value = self.instance_variable_get(var)
hash[var.to_s.delete('@')] = value.respond_to?(:to_hash) ? value.to_hash : value
end
hash
end
|
#to_json ⇒ Object
16
17
18
|
# File 'lib/infobip/sms_api/model/base.rb', line 16
def to_json
self.to_hash.to_json
end
|