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_h, #to_pairs, #to_s, #validate!

Constructor Details

#initialize(other) ⇒ Clone

Returns a new instance of Clone.



76
77
78
79
80
81
82
83
84
# File 'lib/confsources.rb', line 76

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