RubyGems Navigation menu

namedarguments 0.0.3

Adds the ability to call class constructors with a hash of arguments to initialize attributes in the new object. == FEATURES/PROBLEMS: class Snark include NamedArguments attr_accessor :color, :size, :name attribute_defaults :color => 'blue', :size => lambda {|s| some_method_call(s)} required_fields :color, :name required_respond_to :name => :to_s required_kind_of? :size => Fixnum type_conversion :size => Fixnum end s = Snark.new :boojum => 7, :color => red == INSTALL:

Versions:

  1. 0.0.5 - June 3, 2007 (9 KB)
  2. 0.0.3 - December 6, 2006 (8.5 KB)
  3. 0.0.2 - December 5, 2006 (8 KB)
  4. 0.0.1 - December 6, 2006 (8.5 KB)

Runtime Dependencies:

Authors:

  • James M Moore

Owners:

87a1b4114f307e1a4f4c9968ccb92a04

Total downloads 5,851

For this version 1,432

Required Ruby Version: None

Licenses:

N/A

Gemfile:
gem 'namedarguments', '~> 0.0.3' = Copy to clipboard Copied!

install:
gem install namedarguments -v 0.0.3 = Copy to clipboard Copied!

Links: