Class: MobilyAccount
- Inherits:
-
Object
- Object
- MobilyAccount
- Defined in:
- lib/mobily/mobily_account.rb
Instance Method Summary collapse
- #change_password(new_password) ⇒ Object
- #check_balance ⇒ Object
- #forgot_password(send_to_email = true) ⇒ Object
-
#initialize(auth) ⇒ MobilyAccount
constructor
A new instance of MobilyAccount.
Constructor Details
#initialize(auth) ⇒ MobilyAccount
Returns a new instance of MobilyAccount.
6 7 8 |
# File 'lib/mobily/mobily_account.rb', line 6 def initialize(auth) @auth = auth end |
Instance Method Details
#change_password(new_password) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/mobily/mobily_account.rb', line 10 def change_password(new_password) # changePassword api method wrapper request_handler = MobilyApiJsonRequestHandler.new(@auth) request_handler.set_api_method('changePassword') request_handler.add_parameter('newPassword', new_password) request_handler.handle end |
#check_balance ⇒ Object
27 28 29 30 31 32 |
# File 'lib/mobily/mobily_account.rb', line 27 def check_balance # balance api method wrapper request_handler = MobilyApiJsonRequestHandler.new(@auth) request_handler.set_api_method('balance') request_handler.handle.get('balance') end |
#forgot_password(send_to_email = true) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/mobily/mobily_account.rb', line 18 def forgot_password(send_to_email=true) # forgotPassword api method wrapper request_handler = MobilyApiJsonRequestHandler.new(@auth) request_type = send_to_email ? 2 : 1 request_handler.set_api_method('forgetPassword') request_handler.add_parameter('type', request_type) request_handler.handle end |