Class: SchemaTest::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/schema_test/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



20
21
22
23
24
25
# File 'lib/schema_test/configuration.rb', line 20

def initialize
  @domain = 'example.com'
  @definition_paths = []
  @disable_rubocop = false
  @compiled = false
end

Instance Attribute Details

#compiledObject

Set to true to use pre-compiled JSON schema files for validation instead of inlining expanded schemas into test files.



18
19
20
# File 'lib/schema_test/configuration.rb', line 18

def compiled
  @compiled
end

#definition_pathsObject

This should be an array or one or more paths. All ruby files under these paths will all be loaded when SchemaTest.setup! is called. You can nest files in as many subdirectories are you like.



10
11
12
# File 'lib/schema_test/configuration.rb', line 10

def definition_paths
  @definition_paths
end

#disable_rubocopObject

Set to true in order to disable running rubocop on the expanded schemas, as the Ruby PP output does not conform to rubocop's standards.



14
15
16
# File 'lib/schema_test/configuration.rb', line 14

def disable_rubocop
  @disable_rubocop
end

#domainObject

The domain is used to contstruct the $id part of the generated JSON-Schema definitions. This can be set to anything you like really.



5
6
7
# File 'lib/schema_test/configuration.rb', line 5

def domain
  @domain
end