Sha256: f47c3db16da1c70acb2d638ffee0e1412db36efd85475d258cf738022bd6dd17
Contents?: true
Size: 302 Bytes
Versions: 3
Compression:
Stored size: 302 Bytes
Contents
# frozen_string_literal: false if Lite::Ruby.configuration.monkey_patches.include?('struct') class Struct def attributes each_pair.with_object({}) { |(key, val), hash| hash[key] = val } end def replace(args) args.each_pair { |key, val| self[key] = val } end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
lite-ruby-1.3.3 | lib/lite/ruby/struct.rb |
lite-ruby-1.3.2 | lib/lite/ruby/struct.rb |
lite-ruby-1.3.1 | lib/lite/ruby/struct.rb |