Class: Adhearsion::VoIP::Asterisk::ConfigFileGenerators::Voicemail::ContextDefinition::MailboxDefinition
- Inherits:
-
Object
- Object
- Adhearsion::VoIP::Asterisk::ConfigFileGenerators::Voicemail::ContextDefinition::MailboxDefinition
- Defined in:
- lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb
Instance Attribute Summary collapse
-
#mailbox_number ⇒ Object
readonly
Returns the value of attribute mailbox_number.
Instance Method Summary collapse
- #email(str) ⇒ Object
-
#initialize(mailbox_number) ⇒ MailboxDefinition
constructor
A new instance of MailboxDefinition.
- #name(str) ⇒ Object
- #pin_number(number) ⇒ Object
- #to_hash ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(mailbox_number) ⇒ MailboxDefinition
Returns a new instance of MailboxDefinition.
108 109 110 111 112 113 |
# File 'lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb', line 108 def initialize(mailbox_number) check_numeric mailbox_number @mailbox_number = mailbox_number @definition = {} super() end |
Instance Attribute Details
#mailbox_number ⇒ Object (readonly)
Returns the value of attribute mailbox_number.
107 108 109 |
# File 'lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb', line 107 def mailbox_number @mailbox_number end |
Instance Method Details
#email(str) ⇒ Object
124 125 126 |
# File 'lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb', line 124 def email(str) @definition[:email] = str end |
#name(str) ⇒ Object
120 121 122 |
# File 'lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb', line 120 def name(str) @definition[:name] = str end |
#pin_number(number) ⇒ Object
115 116 117 118 |
# File 'lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb', line 115 def pin_number(number) check_numeric number @definition[:pin_number] = number end |
#to_hash ⇒ Object
128 129 130 |
# File 'lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb', line 128 def to_hash @definition end |
#to_s ⇒ Object
132 133 134 |
# File 'lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb', line 132 def to_s %(#{mailbox_number} => #{@definition[:pin_number]},#{@definition[:name]},#{@definition[:email]})[/^(.+?),*$/,1] end |