Class: DIDWW::Resource::VoiceInTrunk

Inherits:
Base
  • Object
show all
Defined in:
lib/didww/resource/voice_in_trunk.rb

Constant Summary collapse

CLI_FORMAT_RAW =

Allowed values for trunk.cli_format

'raw'
CLI_FORMAT_E164 =
'e164'
CLI_FORMAT_LOCAL =
'local'
CLI_FORMATS =
{
  CLI_FORMAT_RAW   => 'Raw',
  CLI_FORMAT_E164  => 'E.164',
  CLI_FORMAT_LOCAL => 'Local'
}.freeze
CONF_TYPE_SIP =

Configuration types

'sip_configurations'
CONF_TYPE_H323 =
'h323_configurations'
CONF_TYPE_IAX2 =
'iax2_configurations'
CONF_TYPE_PSTN =
'pstn_configurations'
CONF_TYPES =
{
  CONF_TYPE_SIP   => 'SIP',
  CONF_TYPE_H323  => 'H323',
  CONF_TYPE_IAX2  => 'IAX2',
  CONF_TYPE_PSTN  => 'PSTN'
}.freeze
CONF_TYPE_CLASSES =
{
  CONF_TYPE_SIP   => DIDWW::ComplexObject::SipConfiguration,
  CONF_TYPE_H323  => DIDWW::ComplexObject::H323Configuration,
  CONF_TYPE_IAX2  => DIDWW::ComplexObject::Iax2Configuration,
  CONF_TYPE_PSTN  => DIDWW::ComplexObject::PstnConfiguration
}.freeze

Instance Method Summary collapse

Methods inherited from Base

#as_json_api

Constructor Details

#initialize(*args) ⇒ VoiceInTrunk

Type: DateTime Description: Trunk created at DateTime



89
90
91
92
# File 'lib/didww/resource/voice_in_trunk.rb', line 89

def initialize(*args)
  super
  attribute_will_change!(:configuration) if configuration
end

Instance Method Details

#cli_format_humanObject



94
95
96
# File 'lib/didww/resource/voice_in_trunk.rb', line 94

def cli_format_human
  CLI_FORMATS[cli_format]
end

#configuration_type_humanObject



98
99
100
# File 'lib/didww/resource/voice_in_trunk.rb', line 98

def configuration_type_human
  CONF_TYPES[configuration.type] if configuration
end