Class: Adhearsion::VoIP::Asterisk::ConfigFileGenerators::Voicemail::ContextDefinition
- Inherits:
-
AsteriskConfigGenerator
- Object
- AsteriskConfigGenerator
- Adhearsion::VoIP::Asterisk::ConfigFileGenerators::Voicemail::ContextDefinition
- 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
-
#mailboxes ⇒ Object
readonly
Returns the value of attribute mailboxes.
Instance Method Summary collapse
-
#initialize(name) ⇒ ContextDefinition
constructor
A new instance of ContextDefinition.
- #mailbox(mailbox_number) {|box| ... } ⇒ Object
-
#to_s ⇒ Object
TODO: This will hold a lot of the methods from the [general] section!.
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
#mailboxes ⇒ Object (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
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_s ⇒ Object
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 |