Sha256: 1ef8ca0b73a749290c1e2c53052b467c5ad2280a747127dab5486d910a6398ea

Contents?: true

Size: 265 Bytes

Versions: 71

Compression:

Stored size: 265 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)| send("#{k}=", v) }
    yield(self) if block_given?
  end
end

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
tracksperanto-1.7.3 lib/tracksperanto/block_init.rb
tracksperanto-1.7.2 lib/tracksperanto/block_init.rb
tracksperanto-1.7.1 lib/tracksperanto/block_init.rb
tracksperanto-1.7.0 lib/tracksperanto/block_init.rb
tracksperanto-1.6.9 lib/tracksperanto/block_init.rb
tracksperanto-1.6.8 lib/tracksperanto/block_init.rb
tracksperanto-1.6.7 lib/tracksperanto/block_init.rb
tracksperanto-1.6.6 lib/tracksperanto/block_init.rb
tracksperanto-1.6.5 lib/tracksperanto/block_init.rb
tracksperanto-1.6.4 lib/tracksperanto/block_init.rb
tracksperanto-1.6.3 lib/tracksperanto/block_init.rb
tracksperanto-1.6.2 lib/tracksperanto/block_init.rb
tracksperanto-1.6.1 lib/tracksperanto/block_init.rb
tracksperanto-1.6.0 lib/tracksperanto/block_init.rb
tracksperanto-1.5.7 lib/tracksperanto/block_init.rb
tracksperanto-1.5.6 lib/tracksperanto/block_init.rb
tracksperanto-1.5.5 lib/tracksperanto/block_init.rb
tracksperanto-1.5.4 lib/tracksperanto/block_init.rb
tracksperanto-1.5.3 lib/tracksperanto/block_init.rb
tracksperanto-1.5.2 lib/tracksperanto/block_init.rb