Module: OnSIP::Account::ClassMethods
- Included in:
- OnSIP::Account
- Defined in:
- lib/onsip/models/account.rb
Instance Method Summary collapse
-
#edit_add_credit(*args) ⇒ Object
TODO.
-
#edit_contact(*args) ⇒ Object
TODO.
-
#edit_recharge(*args) ⇒ Object
TODO.
-
#invoice_browse(*args) ⇒ Object
TODO.
-
#invoice_read(*args) ⇒ Object
TODO.
- #process_read_account_response(response) ⇒ Object
- #read(account_id) {|response| ... } ⇒ Object
Instance Method Details
#edit_add_credit(*args) ⇒ Object
TODO
52 53 54 |
# File 'lib/onsip/models/account.rb', line 52 def edit_add_credit(*args) raise NotImplementedError end |
#edit_contact(*args) ⇒ Object
TODO
47 48 49 |
# File 'lib/onsip/models/account.rb', line 47 def edit_contact(*args) raise NotImplementedError end |
#edit_recharge(*args) ⇒ Object
TODO
57 58 59 |
# File 'lib/onsip/models/account.rb', line 57 def edit_recharge(*args) raise NotImplementedError end |
#invoice_browse(*args) ⇒ Object
TODO
67 68 69 |
# File 'lib/onsip/models/account.rb', line 67 def invoice_browse(*args) raise NotImplementedError end |
#invoice_read(*args) ⇒ Object
TODO
62 63 64 |
# File 'lib/onsip/models/account.rb', line 62 def invoice_read(*args) raise NotImplementedError end |
#process_read_account_response(response) ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/onsip/models/account.rb', line 36 def process_read_account_response(response) account = nil key_path = %w(Response Result AccountRead Account) a = ResponseParser.parse_response response, key_path account = (a.map { |h| new h }).first if a account end |
#read(account_id) {|response| ... } ⇒ Object
30 31 32 33 34 |
# File 'lib/onsip/models/account.rb', line 30 def read(account_id) response = OnSIP.connection.get('/api', {'Action' => 'AccountRead', 'AccountId' => account_id, 'SessionId' => OnSIP.session.id, 'Output' => 'json'}, {}) yield response if block_given? process_read_account_response response end |