Class: Ecko::Plugins::Sponsor::SchemaValidator::GatewayValidator

Inherits:
Base
  • Object
show all
Defined in:
lib/ecko/plugins/sponsor/schema_validator.rb

Instance Attribute Summary

Attributes inherited from Base

#schema

Instance Method Summary collapse

Methods inherited from Base

#initialize, validate

Constructor Details

This class inherits a constructor from Ecko::Plugins::Sponsor::SchemaValidator::Base

Instance Method Details

#validateObject

Validate all the gateway schema which helps in providing correct structure for the gateways that is used for donation

Raises:



29
30
31
32
33
34
35
# File 'lib/ecko/plugins/sponsor/schema_validator.rb', line 29

def validate
  # Validate name
  raise InvalidGatewayName if schema[:name].nil?

  # validate checkout
  raise InvalidGatewayCheckout if schema[:checkout].nil? || !schema[:checkout].is_a?(Class)
end