RubyGems Navigation menu

better-initialize 0.0.1

# 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 git@github.com:huned/better-initialize rbenv install -k `cat .ruby-version` bundle exec ruby test/run.rb

Gemfile:
= Copy to clipboard Copied!

install:
=

Versions:

  1. 0.0.1 - March 08, 2015 (6 KB)

Development Dependencies (2):

byebug >= 0
test-unit >= 0

Owners:

Authors:

  • Huned Botee

SHA 256 checksum:

3f99a39382f8aa9be09905d91cede9dc3856639ffe9dc8f33c8893c0806caca8

Total downloads 3,549

For this version 3,549

License:

MIT

Required Ruby Version: >= 0

Links: