Class: Jaina::Parser::Expression::Registry Private

Inherits:
Object
  • Object
show all
Defined in:
lib/jaina/parser/expression/registry.rb,
lib/jaina/parser/expression/registry/access_interface_mixin.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

Defined Under Namespace

Modules: AccessInterfaceMixin

Constant Summary collapse

Error =

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

Since:

  • 0.1.0

Class.new(StandardError)
AlreadyRegisteredExpressionError =

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

Since:

  • 0.1.0

Class.new(Error)
UnregisteredExpressionError =

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

Since:

  • 0.1.0

Class.new(Error)
IncorrectExpressionObjectError =

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

Since:

  • 0.1.0

Class.new(Error)

Instance Method Summary collapse

Constructor Details

#initializevoid

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.

Since:

  • 0.1.0



21
22
23
24
# File 'lib/jaina/parser/expression/registry.rb', line 21

def initialize
  @expression_set = {}
  @access_lock = Mutex.new
end

Instance Method Details

#[](expression_token) ⇒ Class{Jaina::Parser::Operator::Abstract}

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_token (String)

Returns:

  • (Class{Jaina::Parser::Operator::Abstract})

Since:

  • 0.1.0



31
32
33
# File 'lib/jaina/parser/expression/registry.rb', line 31

def [](expression_token)
  thread_safe { fetch(expression_token) }
end

#expressionsArray<String>

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:

  • (Array<String>)

Since:

  • 0.1.0



48
49
50
# File 'lib/jaina/parser/expression/registry.rb', line 48

def expressions
  thread_safe { expression_names }
end

#register(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.

This method returns an undefined value.

Parameters:

  • expression (Class{Jaina::Parser::Operator::Abstract})

Since:

  • 0.1.0



40
41
42
# File 'lib/jaina/parser/expression/registry.rb', line 40

def register(expression)
  thread_safe { apply(expression) }
end