Project

optionize

0.0
No commit activity in last 3 years
No release in over 3 years
method argument utils
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme
Optionize
=========

  argument helper


Usage
=====

  Optionize can extract args with various formats like this.

    user("maiha", 14)
    user(:name => 'maiha', :age => 14)
    user("maiha", :age => 14)


  In this case, we define 'user' method as following

    require 'optionize'
    def user(*args)
      opts = Optionize.new(args, :name, :age)
      opts[:name] # => "maiha"
      opts.name   # => "maiha"
      opts[:age]  # => 14


Extensions
==========

  Extend Array class to respond to optionize method 

    require 'optionize/array'
    opts = ['maiha'].optionize(:name, :age)
    opts.name # => 'maiha'
    opts.age  # => nil

Install
=======

  gem install optionize


Homepage
========

  git://github.com/maiha/optionize.git


Author
======
  Maiha <maiha@wota.jp>