Class: RouteNGNClient::Route
- Defined in:
- lib/routengn_client/models/route.rb
Instance Attribute Summary
Attributes inherited from Model
#attributes, #request_account_id
Attributes included from Model::ClassMethods
#children, #only_children, #parents
Instance Method Summary collapse
- #blocked? ⇒ Boolean
- #build_aors(sip_request, inbound_end_point_group, options = {}) ⇒ Object
- #build_contacts(end_points = nil) ⇒ Object
- #contacts ⇒ Object
- #inbound_rate ⇒ Object
Methods inherited from Model
#initialize, #to_hash, #to_json, #to_log
Methods included from Model::ClassMethods
#belongs_to, #from_hash, #from_json, #has_many, #has_one
Methods included from Logging
Constructor Details
This class inherits a constructor from RouteNGNClient::Model
Instance Method Details
#blocked? ⇒ Boolean
28 29 30 |
# File 'lib/routengn_client/models/route.rb', line 28 def blocked? @attributes.has_key?('blocked') && @attributes.blocked == 'true' ? true : false end |
#build_aors(sip_request, inbound_end_point_group, options = {}) ⇒ Object
20 21 22 |
# File 'lib/routengn_client/models/route.rb', line 20 def build_aors(sip_request, inbound_end_point_group, = {}) self.contacts.collect { |c| c.build_aor(sip_request, inbound_end_point_group, ) } end |
#build_contacts(end_points = nil) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/routengn_client/models/route.rb', line 11 def build_contacts(end_points = nil) if oepg = self.outbound_end_point_group end_points ||= oepg.prioritized_end_points @contacts = end_points.collect do |end_point| Contact.new(:end_point => end_point, :route => self) end end end |
#contacts ⇒ Object
7 8 9 |
# File 'lib/routengn_client/models/route.rb', line 7 def contacts @contacts ||= self.build_contacts end |
#inbound_rate ⇒ Object
24 25 26 |
# File 'lib/routengn_client/models/route.rb', line 24 def inbound_rate @attributes.inbound_rate end |