Class: Adhearsion::Asterisk::ConfigGenerator::Voicemail::ContextDefinition
- Inherits:
-
Adhearsion::Asterisk::ConfigGenerator
- Object
- Adhearsion::Asterisk::ConfigGenerator
- Adhearsion::Asterisk::ConfigGenerator::Voicemail::ContextDefinition
- Defined in:
- lib/adhearsion/asterisk/config_generator/voicemail.rb
Defined Under Namespace
Classes: MailboxDefinition
Constant Summary
Constants inherited from Adhearsion::Asterisk::ConfigGenerator
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 Adhearsion::Asterisk::ConfigGenerator
create_sanitary_hash_from, #to_sanitary_hash, warning_message
Constructor Details
#initialize(name) ⇒ ContextDefinition
Returns a new instance of ContextDefinition.
77 78 79 80 81 |
# File 'lib/adhearsion/asterisk/config_generator/voicemail.rb', line 77 def initialize(name) @name = name @mailboxes = [] super() end |
Instance Attribute Details
#mailboxes ⇒ Object (readonly)
Returns the value of attribute mailboxes.
76 77 78 |
# File 'lib/adhearsion/asterisk/config_generator/voicemail.rb', line 76 def mailboxes @mailboxes end |
Instance Method Details
#mailbox(mailbox_number) {|box| ... } ⇒ Object
89 90 91 92 93 |
# File 'lib/adhearsion/asterisk/config_generator/voicemail.rb', line 89 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!
85 86 87 |
# File 'lib/adhearsion/asterisk/config_generator/voicemail.rb', line 85 def to_s (%W[[#@name]] + mailboxes.map(&:to_s)).join "\n" end |