Module: RocketApi::Validation

Defined in:
lib/rocket_api/validation.rb

Instance Method Summary collapse

Instance Method Details

#available_to_init?Boolean

Returns:

  • (Boolean)

Raises:



12
13
14
15
16
# File 'lib/rocket_api/validation.rb', line 12

def available_to_init?
  raise RocketApi::APP_DETECTED unless RocketApi::CHECK_APPS.map { |p| Dir.glob(p) }.flatten.empty?
rescue StandardError => e
  raise RocketApi::ValidationError, e.message
end

#validate_commands(*commands) ⇒ Object

Raises:



5
6
7
8
9
# File 'lib/rocket_api/validation.rb', line 5

def validate_commands(*commands)
  raise RocketApi::WRONG_RESPONSE if commands.any?(&:nil?)
rescue StandardError => e
  raise RocketApi::ValidationError, e.message
end