Class: Diameter::Internals::AVPNames
- Inherits:
-
Object
- Object
- Diameter::Internals::AVPNames
- Includes:
- Constants
- Defined in:
- lib/diameter/avp.rb
Overview
Maps AVP names to their on-the-wire values and data definitions.
Constant Summary
Constants included from Constants
Constants included from Constants::Vendors
Constants included from Constants::AVPType
Constants::AVPType::GROUPED, Constants::AVPType::IPADDR, Constants::AVPType::OCTETSTRING, Constants::AVPType::U32
Class Method Summary collapse
- .add(name, code, type, vendor = nil) ⇒ Object
-
.get(name) ⇒ Array(Fixnum, AVPType), Array(Fixnum, AVPType, Vendor)
Converts an AVP name into its code number, data type, and (if applicable) vendor ID.
Class Method Details
.add(name, code, type, vendor = nil) ⇒ Object
28 29 30 |
# File 'lib/diameter/avp.rb', line 28 def self.add(name, code, type, vendor=nil) @custom_avps[name] = vendor.nil? ? [code, type] : [code, type, vendor] end |
.get(name) ⇒ Array(Fixnum, AVPType), Array(Fixnum, AVPType, Vendor)
Converts an AVP name into its code number, data type, and (if applicable) vendor ID.
20 21 22 23 24 25 |
# File 'lib/diameter/avp.rb', line 20 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 |