Sha256: 638ab4dca0cea938ec5a5b51b4415dd07c2d14bfca1ab7a6c7cfae146e569bf1

Contents?: true

Size: 359 Bytes

Versions: 18

Compression:

Stored size: 359 Bytes

Contents

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

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
tracksperanto-3.5.9 lib/tracksperanto/block_init.rb
tracksperanto-3.5.8 lib/tracksperanto/block_init.rb
tracksperanto-3.5.7 lib/tracksperanto/block_init.rb
tracksperanto-3.5.6 lib/tracksperanto/block_init.rb
tracksperanto-3.5.5 lib/tracksperanto/block_init.rb
tracksperanto-3.5.4 lib/tracksperanto/block_init.rb
tracksperanto-3.5.2 lib/tracksperanto/block_init.rb
tracksperanto-3.5.1 lib/tracksperanto/block_init.rb
tracksperanto-3.5.0 lib/tracksperanto/block_init.rb
tracksperanto-3.4.1 lib/tracksperanto/block_init.rb
tracksperanto-3.4.0 lib/tracksperanto/block_init.rb
tracksperanto-3.3.13 lib/tracksperanto/block_init.rb
tracksperanto-3.3.12 lib/tracksperanto/block_init.rb
tracksperanto-3.3.11 lib/tracksperanto/block_init.rb
tracksperanto-3.3.10 lib/tracksperanto/block_init.rb
tracksperanto-3.3.9 lib/tracksperanto/block_init.rb
tracksperanto-3.3.8 lib/tracksperanto/block_init.rb
tracksperanto-3.3.7 lib/tracksperanto/block_init.rb