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:
= 複製 已複製

安裝:
=

版本列表:

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

Development 相依性套件 (2):

byebug >= 0
test-unit >= 0

擁有者:

作者:

  • Huned Botee

SHA 256 checksum:

3f99a39382f8aa9be09905d91cede9dc3856639ffe9dc8f33c8893c0806caca8

總下載次數 3,558

這個版本 3,558

License:

MIT

Ruby 版本需求: >= 0

相關連結: