Module: ValueStruct::StrictArguments
- Defined in:
- lib/value_struct/strict_arguments.rb
Instance Method Summary collapse
Instance Method Details
#initialize(*args, &block) ⇒ Object
2 3 4 5 6 7 |
# File 'lib/value_struct/strict_arguments.rb', line 2 def initialize(*args, &block) super *args, &block unless size == args.size + (args[0].is_a?(String) ? 1 : 0) raise ArgumentError, "wrong number of arguments (#{args.size} for #{members.size})" end end |