Class: Adhearsion::PathString
- Defined in:
- lib/adhearsion/initializer.rb
Instance Attribute Summary collapse
-
#component_path ⇒ Object
Returns the value of attribute component_path.
-
#dialplan_path ⇒ Object
Returns the value of attribute dialplan_path.
-
#log_path ⇒ Object
Returns the value of attribute log_path.
Instance Method Summary collapse
- #base_path=(value) ⇒ Object
- #defaults ⇒ Object
- #dial_plan_named(name) ⇒ Object
-
#initialize(path) ⇒ PathString
constructor
A new instance of PathString.
- #using_base_path(temporary_base_path, &block) ⇒ Object
Methods inherited from String
Constructor Details
#initialize(path) ⇒ PathString
Returns a new instance of PathString.
6 7 8 9 |
# File 'lib/adhearsion/initializer.rb', line 6 def initialize(path) super defaults end |
Instance Attribute Details
#component_path ⇒ Object
Returns the value of attribute component_path.
4 5 6 |
# File 'lib/adhearsion/initializer.rb', line 4 def component_path @component_path end |
#dialplan_path ⇒ Object
Returns the value of attribute dialplan_path.
4 5 6 |
# File 'lib/adhearsion/initializer.rb', line 4 def dialplan_path @dialplan_path end |
#log_path ⇒ Object
Returns the value of attribute log_path.
4 5 6 |
# File 'lib/adhearsion/initializer.rb', line 4 def log_path @log_path end |
Instance Method Details
#base_path=(value) ⇒ Object
17 18 19 20 |
# File 'lib/adhearsion/initializer.rb', line 17 def base_path=(value) replace(value) defaults end |
#defaults ⇒ Object
11 12 13 14 15 |
# File 'lib/adhearsion/initializer.rb', line 11 def defaults @component_path = build_path_for "components" @dialplan_path = dup @log_path = build_path_for "logs" end |
#dial_plan_named(name) ⇒ Object
30 31 32 |
# File 'lib/adhearsion/initializer.rb', line 30 def dial_plan_named(name) File.join(dialplan_path, name) end |
#using_base_path(temporary_base_path, &block) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/adhearsion/initializer.rb', line 22 def using_base_path(temporary_base_path, &block) original_path = dup self.base_path = temporary_base_path block.call ensure self.base_path = original_path end |