Method: Phony::TrunkCode#initialize
- Defined in:
- lib/phony/trunk_code.rb
#initialize(code, options = {}) ⇒ TrunkCode
Parameters:
* code: The trunk code, e.g. 0.
Options:
* normalize: [true (default), false] Remove the trunk code when normalizing (only use if number scheme is defined unambiguously).
* split: [true, false (default)] Remove the trunk code when splitting (only use if number scheme is defined unambiguously).
* format: [true (default), false] Add the trunk code when formatting (passing `false` will not add it).
13 14 15 16 17 18 19 |
# File 'lib/phony/trunk_code.rb', line 13 def initialize(code, = {}) @code = code @trunk_code_replacement = /\A#{code.gsub(/%s/, '')}/ @normalize = [:normalize] || [:normalize].nil? @split = [:split] @format = [:format] || [:format].nil? end |