lib/tracksperanto/block_init.rb in tracksperanto-4.1.3 vs lib/tracksperanto/block_init.rb in tracksperanto-4.2.0

- old
+ new

@@ -1,7 +1,7 @@ # 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) } + def initialize(attributes = {}) + attributes.map { |(k, v)| public_send("#{k}=", v) } yield(self) if block_given? end end