Class: SmartCore::Types::Primitive::Checker Private

Inherits:
Object
  • Object
show all
Defined in:
lib/smart_core/types/primitive/checker.rb

Overview

This class is part of a private API. You should avoid using this class 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

Constructor Details

#initialize(expression) ⇒ void

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.

Parameters:

  • expression (Proc)

Since:

  • 0.1.0



12
13
14
# File 'lib/smart_core/types/primitive/checker.rb', line 12

def initialize(expression)
  @expression = expression
end

Instance Method Details

#call(value, runtime_attributes) ⇒ Boolean

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.

Parameters:

  • value (Any)
  • runtime_attributes (Array<Any>)

Returns:

  • (Boolean)

Since:

  • 0.1.0

Version:

  • 0.3.0



23
24
25
# File 'lib/smart_core/types/primitive/checker.rb', line 23

def call(value, runtime_attributes)
  !!expression.call(value, runtime_attributes)
end