Refactor action arguments checks

This commit is contained in:
Thibault Jouan
2014-10-09 19:54:32 +00:00
parent 5549ebc676
commit 7bdb778159
3 changed files with 8 additions and 8 deletions

View File

@@ -30,6 +30,12 @@ module Producer
def inspect_arguments
@arguments.inspect[0, INSPECT_ARGUMENTS_SUM_LEN - name.length]
end
def check_arguments_size!(size)
if arguments.compact.size != size
fail ArgumentError, '`%s\' action requires %d arguments' % [name, size]
end
end
end
end
end