Sha256: 8ff023d3c03957ed9ba739a35bc69db333417a86db68875308e5c34a354d79d8

Contents?: true

Size: 234 Bytes

Versions: 1

Compression:

Stored size: 234 Bytes

Contents

class KwStruct < Struct
  VERSION = '0.1.0'

  def self.new(*members)
    class_eval <<-RUBY
      def initialize(#{members.map{|m| "#{m}: nil"}.join(', ')})
        super(#{members.join(', ')})
      end
    RUBY
    super
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kwstruct-0.1.0 lib/kwstruct.rb