lib/legion/settings/validators/legion.rb in legion-settings-0.1.1 vs lib/legion/settings/validators/legion.rb in legion-settings-0.2.0
- old
+ new
@@ -1,13 +1,9 @@
module Legion
module Settings
module Validators
module Legion
- # Validate Legion spawn.
- # Validates: limit
- #
- # @param legion [Hash] legion definition.
def validate_legion_spawn(legion)
spawn = legion[:spawn]
if is_a_hash?(spawn)
if is_an_integer?(spawn[:limit])
(spawn[:limit]).positive? ||
@@ -18,13 +14,9 @@
else
invalid(legion, 'legion spawn must be a hash')
end
end
- # Validate a Legion definition.
- # Validates: spawn
- #
- # @param legion [Hash] legion definition.
def validate_legion(legion)
if is_a_hash?(legion)
validate_legion_spawn(legion)
else
invalid(legion, 'legion must be a hash')