Module: DeepCover::StructWithOptions

Defined in:
lib/deep_cover/tools/struct_with_options.rb

Defined Under Namespace

Modules: Initializer

Class Method Summary collapse

Class Method Details

.new(*args) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/deep_cover/tools/struct_with_options.rb', line 11

def self.new(*args)
  Struct.new(*args, :options).tap do |klass|
    klass.include Initializer
    class << klass
      undef_method :new
    end
    klass.define_singleton_method(:new, Class.method(:new))
  end
end