Categories: None [Edit]

better-initialize

https://rubygems.org/gems/better-initialize
https://github.com/huned/better-initialize
# better-initialize A friendlier, dependency-free initialize method for ruby objects. ## Usage Gemfile: gem 'better-initialize', github: 'huned/better-initialize' Code: require 'better_initialize' class Pizza include BetterInitialize attr_accessor :size, :toppings end # Instantiate with attributes. Pizza.new(size: :large, toppings: %i[mushrooms peppers]) # Instantiate with attributes and a block. Pizza.new(size: :large) do |pizza| pizza.toppings = %w[mushrooms peppers] Oven.bake!(pizza) end ## Development Environment (OSX) brew install rbenv ruby-build git clone [email protected]:huned/better-initialize rbenv install -k `cat .ruby-version` bundle exec ruby test/run.rb

Total

Ranking: 141,721 of 180,543
Downloads: 3,559

Daily

Ranking: 102,505 of 180,534
Downloads: 1

Depended by

RankDownloadsName

Depends on

RankDownloadsName
93322,795,471byebug
63859,510,695test-unit

Owners

#GravatarHandle
1iconhuned4real