Class: ConfSources::Clone

Inherits:
Default
  • Object
show all
Defined in:
lib/confsources.rb

Instance Attribute Summary

Attributes inherited from Default

#options

Instance Method Summary collapse

Methods inherited from Default

#[], #export_to, #is_defined?, #merge, #merge!, #to_a, #to_pairs, #to_s, #validate!

Constructor Details

#initialize(other) ⇒ Clone


68
69
70
71
72
73
74
75
76
# File 'lib/confsources.rb', line 68

def initialize other
    if other.kind_of? Default
        @options = other.options.collect {|el|el.clone}
    elsif other.is_a? Array
        @options = other.collect {|el| el.clone}
    else
        raise RuntimeError, "Can't clone configuration sorce from #{other.class}"
    end
end