Class: Adhearsion::VoIP::Asterisk::ConfigFileGenerators::Voicemail::ContextDefinition

Inherits:
AsteriskConfigGenerator show all
Defined in:
lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb

Defined Under Namespace

Classes: MailboxDefinition

Constant Summary

Constants inherited from AsteriskConfigGenerator

AsteriskConfigGenerator::SECTION_TITLE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AsteriskConfigGenerator

create_sanitary_hash_from, #to_sanitary_hash, warning_message

Constructor Details

#initialize(name) ⇒ ContextDefinition

Returns a new instance of ContextDefinition.



78
79
80
81
82
# File 'lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb', line 78

def initialize(name)
  @name      = name
  @mailboxes = []
  super()
end

Instance Attribute Details

#mailboxesObject (readonly)

Returns the value of attribute mailboxes.



77
78
79
# File 'lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb', line 77

def mailboxes
  @mailboxes
end

Instance Method Details

#mailbox(mailbox_number) {|box| ... } ⇒ Object

Yields:

  • (box)


90
91
92
93
94
# File 'lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb', line 90

def mailbox(mailbox_number)
  box = MailboxDefinition.new(mailbox_number)
  yield box
  mailboxes << box
end

#to_sObject

TODO: This will hold a lot of the methods from the [general] section!



86
87
88
# File 'lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb', line 86

def to_s
  (%W[[#@name]] + mailboxes.map(&:to_s)).join "\n"
end