method arguments utils
License
maiha/optionize
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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>
About
method arguments utils
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published