Sha256: cd60ee10e8f0f6ef35e1353bb6d09815a0622024a9c59e9b501520b7e26f7445

Contents?: true

Size: 269 Bytes

Versions: 4

Compression:

Stored size: 269 Bytes

Contents

# Implements the conventional constructor with "hash of attributes" and block support
module Tracksperanto::BlockInit
  def initialize(**object_attribute_hash)
    object_attribute_hash.map { |(k, v)| public_send("#{k}=", v) }
    yield(self) if block_given?
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tracksperanto-4.1.3 lib/tracksperanto/block_init.rb
tracksperanto-4.1.2 lib/tracksperanto/block_init.rb
tracksperanto-4.1.0 lib/tracksperanto/block_init.rb
tracksperanto-4.0.0 lib/tracksperanto/block_init.rb