README.md in option_initializer-1.5.0 vs README.md in option_initializer-1.5.1
- old
+ new
@@ -15,14 +15,14 @@
class Person
include OptionInitializer
option_initializer :id,
- :name => String,
+ :name => String,
:greetings => :&,
- :birthday => 1..3,
- :sex => Set[:male, :female]
+ :birthday => 1..3,
+ :sex => Set[:male, :female]
option_validator :name do |v|
raise ArgumentError, "invalid name" if v.empty?
end
@@ -76,10 +76,10 @@
option_initializer :a, # Single object of any type
:b => 2, # Two objects of any type
:c => 1..3, # 1, 2, or 3 objects of any type
:d => :*, # Any number of objects of any type
:e => :&, # Block
- :f => Fixnum, # Single Fixnum object
+ :f => Fixnum | Range, # Single Fixnum or Range object
:g => [Fixnum, String, Symbol], # Fixnum, String, and Symbol
:h => Set[true, false], # Value must be either true or false
:i => [Fixnum, Set[true, false]] # Fixnum and boolean
# Validator for :f