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.5.1 lib/tracksperanto/block_init.rb
tracksperanto-1.5.0 lib/tracksperanto/block_init.rb
tracksperanto-1.4.0 lib/tracksperanto/block_init.rb
tracksperanto-1.2.6 lib/tracksperanto/block_init.rb
tracksperanto-1.3.1 lib/tracksperanto/block_init.rb
tracksperanto-1.3.0 lib/tracksperanto/block_init.rb
tracksperanto-1.2.4 lib/tracksperanto/block_init.rb
tracksperanto-1.2.3 lib/tracksperanto/block_init.rb
tracksperanto-1.2.2 lib/tracksperanto/block_init.rb
tracksperanto-1.2.1 lib/tracksperanto/block_init.rb
tracksperanto-1.2.0 lib/tracksperanto/block_init.rb