class Diameter::Internals::AVPNames
Maps AVP
names to their on-the-wire values and data definitions.
Public Class Methods
add(name, code, type, vendor=nil)
click to toggle source
@see {AVP.define}
# File lib/diameter/avp.rb, line 29 def self.add(name, code, type, vendor=nil) @custom_avps[name] = vendor.nil? ? [code, type] : [code, type, vendor] end
get(name)
click to toggle source
Converts an AVP
name into its code number, data type, and (if applicable) vendor ID.
@param [String] name The AVP
name @return [Array(Fixnum, AVPType)] if this is not vendor-specific @return [Array(Fixnum, AVPType, Vendor)] if this is vendor-specific
# File lib/diameter/avp.rb, line 21 def self.get(name) code, type, vendor = @custom_avps.merge(AVAILABLE_AVPS)[name] vendor ||= 0 fail "AVP name #{name} not recognised" unless code [code, type, vendor] end