Class: XPain::OptionsEnhancer
- Inherits:
-
Object
- Object
- XPain::OptionsEnhancer
- Defined in:
- lib/xpain/options_enhancer.rb
Constant Summary collapse
- ENH_MAP =
{ :min => :minOccurs, :max => :maxOccurs }
Instance Method Summary collapse
- #enhance ⇒ Object
-
#initialize(opts = {}) ⇒ OptionsEnhancer
constructor
A new instance of OptionsEnhancer.
Constructor Details
#initialize(opts = {}) ⇒ OptionsEnhancer
Returns a new instance of OptionsEnhancer.
8 9 10 |
# File 'lib/xpain/options_enhancer.rb', line 8 def initialize(opts = {}) @opts = opts end |
Instance Method Details
#enhance ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/xpain/options_enhancer.rb', line 12 def enhance ENH_MAP.each do |matcher, replacement| if @opts[matcher] value = @opts.delete(matcher) @opts[replacement] = value end end @opts end |