mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Save data rewrite & Game module (#91)
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
module Kernel
|
||||
private
|
||||
|
||||
# Used to check whether values are of a given class or respond to a method.
|
||||
# Used to check whether method arguments are of a given class or respond to a method.
|
||||
# @param value_pairs [Hash{Object => Class, Array<Class>, Symbol}] value pairs to validate
|
||||
# @example Validate a class or method
|
||||
# validate foo => Integer, baz => :to_s # raises an error if foo is not an Integer or if baz doesn't implement #to_s
|
||||
# @example Validate a class from an array
|
||||
# validate foo => [Sprite, Bitmap, Viewport] # raises an error if foo isn't a Sprite, Bitmap or Viewport
|
||||
# @raise [ArgumentError] raised if validation fails
|
||||
# @raise [ArgumentError] if validation fails
|
||||
def validate(value_pairs)
|
||||
unless value_pairs.is_a?(Hash)
|
||||
raise ArgumentError, "Non-hash argument #{value_pairs.inspect} passed into validate."
|
||||
|
||||
Reference in New Issue
Block a user