Class: Sipwizard::Binding
- Inherits:
-
Hashie::Trash
- Object
- Hashie::Trash
- Sipwizard::Binding
- Defined in:
- lib/sipwizard/binding.rb
Constant Summary collapse
- API_PATH_MAP =
{ count: 'sipaccountbinding/count', find: 'sipaccountbinding/get' }
Class Method Summary collapse
Class Method Details
.count ⇒ Object
21 22 23 24 25 |
# File 'lib/sipwizard/binding.rb', line 21 def self.count response = Connection.new.get(API_PATH_MAP[:count]) response['Success'] ? response['Result'] : -1 end |
.find(id) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/sipwizard/binding.rb', line 31 def self.find(id) relation = self.where({ ID: id }).count(1) result = Connection.new.get(API_PATH_MAP[:find], relation.relation) return nil unless result['Success'] self.new(result['Result'][0]) end |