Sha256: 0197c4e909a6102d79f5b12c4be383cc5d419ed21d650e4663de8ebc69131f87

Contents?: true

Size: 220 Bytes

Versions: 11

Compression:

Stored size: 220 Bytes

Contents

# frozen_string_literal: false

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
lite-ruby-2.3.0 lib/lite/ruby/struct.rb
lite-ruby-2.2.0 lib/lite/ruby/struct.rb
lite-ruby-2.1.0 lib/lite/ruby/struct.rb
lite-ruby-2.0.7 lib/lite/ruby/struct.rb
lite-ruby-2.0.6 lib/lite/ruby/struct.rb
lite-ruby-2.0.5 lib/lite/ruby/struct.rb
lite-ruby-2.0.4 lib/lite/ruby/struct.rb
lite-ruby-2.0.3 lib/lite/ruby/struct.rb
lite-ruby-2.0.2 lib/lite/ruby/struct.rb
lite-ruby-2.0.1 lib/lite/ruby/struct.rb
lite-ruby-2.0.0 lib/lite/ruby/struct.rb