Class: RouteNGNClient::Route

Inherits:
Model
  • Object
show all
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

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

#init_logger, #logger

Constructor Details

This class inherits a constructor from RouteNGNClient::Model

Instance Method Details

#blocked?Boolean

Returns:

  • (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, options = {})
  self.contacts.collect { |c| c.build_aor(sip_request, inbound_end_point_group, options) }
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

#contactsObject



7
8
9
# File 'lib/routengn_client/models/route.rb', line 7

def contacts
  @contacts ||= self.build_contacts
end

#inbound_rateObject



24
25
26
# File 'lib/routengn_client/models/route.rb', line 24

def inbound_rate
  @attributes.inbound_rate
end