Class: OverSIP::SIP::RFC3263::MultiTargets
- Inherits:
-
Array
- Object
- Array
- OverSIP::SIP::RFC3263::MultiTargets
- Defined in:
- lib/oversip/sip/rfc3263.rb
Instance Attribute Summary collapse
-
#has_srv_weight_targets ⇒ Object
Returns the value of attribute has_srv_weight_targets.
Instance Method Summary collapse
Instance Attribute Details
#has_srv_weight_targets ⇒ Object
Returns the value of attribute has_srv_weight_targets.
65 66 67 |
# File 'lib/oversip/sip/rfc3263.rb', line 65 def has_srv_weight_targets @has_srv_weight_targets end |
Instance Method Details
#flatten ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/oversip/sip/rfc3263.rb', line 67 def flatten return self unless @has_srv_weight_targets targets = [] self.each do |entry| if entry.is_a? RFC3263::Target targets << entry # If not, it's a SrvTargets. else targets.concat entry.randomize end end targets end |