Module: OnSIP::Organization::ClassMethods
- Included in:
- OnSIP::Organization
- Defined in:
- lib/onsip/models/organization.rb
Instance Method Summary collapse
-
#add(*args) ⇒ Object
TODO.
- #browse(account_id) {|response| ... } ⇒ Object
-
#edit_authenticated(*args) ⇒ Object
TODO.
-
#edit_contact(*args) ⇒ Object
TODO.
-
#migrate_domain(*args) ⇒ Object
TODO.
- #process_browse_organization_response(response) ⇒ Object
- #process_read_organization_response(response) {|response| ... } ⇒ Object
- #read(organization_id) {|response| ... } ⇒ Object
Instance Method Details
#add(*args) ⇒ Object
TODO
65 66 67 |
# File 'lib/onsip/models/organization.rb', line 65 def add(*args) raise NotImplementedError end |
#browse(account_id) {|response| ... } ⇒ Object
29 30 31 32 33 34 |
# File 'lib/onsip/models/organization.rb', line 29 def browse(account_id) params = {'Action' => 'OrganizationBrowse', 'AccountId' => account_id, 'SessionId' => OnSIP.session.id, 'Output' => 'json'} response = OnSIP.connection.get('/api', params, {}) yield response if block_given? process_browse_organization_response response end |
#edit_authenticated(*args) ⇒ Object
TODO
80 81 82 |
# File 'lib/onsip/models/organization.rb', line 80 def edit_authenticated(*args) raise NotImplementedError end |
#edit_contact(*args) ⇒ Object
TODO
70 71 72 |
# File 'lib/onsip/models/organization.rb', line 70 def edit_contact(*args) raise NotImplementedError end |
#migrate_domain(*args) ⇒ Object
TODO
75 76 77 |
# File 'lib/onsip/models/organization.rb', line 75 def migrate_domain(*args) raise NotImplementedError end |
#process_browse_organization_response(response) ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/onsip/models/organization.rb', line 36 def process_browse_organization_response(response) organizations = [] key_path = %w(Response Result OrganizationBrowse Organizations Organization) a = ResponseParser.parse_response response, key_path organizations = a.map { |h| new h } if a organizations end |
#process_read_organization_response(response) {|response| ... } ⇒ Object
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/onsip/models/organization.rb', line 53 def process_read_organization_response(response) organization = nil key_path = %w(Response Result OrganizationRead Organization) a = ResponseParser.parse_response response, key_path yield response if block_given? organization = (a.map { |h| new h }).first if a organization end |
#read(organization_id) {|response| ... } ⇒ Object
46 47 48 49 50 51 |
# File 'lib/onsip/models/organization.rb', line 46 def read(organization_id) params = {'Action' => 'OrganizationRead', 'OrganizationId' => organization_id, 'SessionId' => OnSIP.session.id, 'Output' => 'json'} response = OnSIP.connection.get('/api', params, {}) yield response if block_given? process_read_organization_response response end |