Sha256: 84c5d828e26c48392e2d79e1c58d45a488de02486444625c94e3c2a4a436dfa5
Contents?: true
Size: 462 Bytes
Versions: 18
Compression:
Stored size: 462 Bytes
Contents
module SmartIoC::Args def check_arg(value, name, klass) if !value.is_a?(klass) raise ArgumentError, ":#{name} should be a #{klass}" end end def check_arg_any(value, name, klasses) if !klasses.detect {|klass| value.is_a?(klass)} raise ArgumentError, ":#{name} should be any of #{klasses.inspect}" end end def not_nil(value, name) if value.nil? raise ArgumentError, ":#{name} should not be blank" end end end
Version data entries
18 entries across 18 versions & 1 rubygems