Module: SmartCore::Schema::DSL::ClassMethods Private

Defined in:
lib/smart_core/schema/dsl.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

Version:

  • 0.3.0

Instance Method Summary collapse

Instance Method Details

#__schema_checker__SmartCore::Schema::Checker

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

Since:

  • 0.1.0



45
46
47
# File 'lib/smart_core/schema/dsl.rb', line 45

def __schema_checker__
  @__schema_checker__
end

#non_strict!void

This method returns an undefined value.

Since:

  • 0.3.0



77
78
79
# File 'lib/smart_core/schema/dsl.rb', line 77

def non_strict!
  __schema_checker__.set_strict_mode(:non_strict)
end

#schema(strict_mode = nil, &definitions) ⇒ void

Note:

nil strict mode means ‘do not change current mode`

This method returns an undefined value.

Parameters:

  • strict_mode (NilClass, String, Symbol) (defaults to: nil)
  • definitions (Block)

Since:

  • 0.1.0

Version:

  • 0.3.0



58
59
60
61
62
63
# File 'lib/smart_core/schema/dsl.rb', line 58

def schema(strict_mode = nil, &definitions)
  __schema_checker__.invoke_in_pipe do
    set_strict_mode(strict_mode)
    append_schema_definitions(&definitions)
  end
end

#strict!void

This method returns an undefined value.

Since:

  • 0.3.0



69
70
71
# File 'lib/smart_core/schema/dsl.rb', line 69

def strict!
  __schema_checker__.set_strict_mode(:strict)
end