Sha256: 1e3383205d7aee5d184d29c057f31f1228a66c8efd74c56ad6bca6c4c5e028de

Contents?: true

Size: 220 Bytes

Versions: 9

Compression:

Stored size: 220 Bytes

Contents

# frozen_string_literal: true

class HashModel
  def initialize(hash)
    hash.each do |attribute, value|
      method_name = "#{attribute}="

      send(method_name, value) if respond_to?(method_name)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sinclair-2.1.1 spec/support/models/hash_model.rb
sinclair-2.1.0 spec/support/models/hash_model.rb
sinclair-2.0.1 spec/support/models/hash_model.rb
sinclair-2.0.0 spec/support/models/hash_model.rb
sinclair-1.16.3 spec/support/models/hash_model.rb
sinclair-1.16.2 spec/support/models/hash_model.rb
sinclair-1.16.1 spec/support/models/hash_model.rb
sinclair-1.16.0 spec/support/models/hash_model.rb
sinclair-1.15.0 spec/support/models/hash_model.rb