Sha256: d964394a1f3c11baa1ecded9606011b5011cbd369e75294f807bf03d749d46ec

Contents?: true

Size: 208 Bytes

Versions: 4

Compression:

Stored size: 208 Bytes

Contents

class Object
  def param_constructor
    self.class_eval('
    def initialize(params={})
      params.each do |attr, value|
        self.public_send("#{attr}=", value)
      end if params
    end')
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
subtle-0.3.6 lib/subtle/param_constructor.rb
subtle-0.3.5 lib/subtle/param_constructor.rb
subtle-0.3.4 lib/subtle/param_constructor.rb
smoke_monster-0.3.3 lib/smoke_monster/param_constructor.rb