Module: Pione::TupleSpace

Included in:
Pione
Defined in:
lib/pione/tuple-space.rb,
lib/pione/tuple-space/relay.rb,
lib/pione/tuple-space/basic-tuple.rb,
lib/pione/tuple-space/tuple-space-server.rb,
lib/pione/tuple-space/tuple-space-exception.rb,
lib/pione/tuple-space/tuple-space-interface.rb

Overview

TupleSpace is a namespace for classes tuple space related.

Defined Under Namespace

Modules: TupleDefinition, TupleSpaceInterface, TupleSpaceServerMethod Classes: BasicTuple, DataTuple, ProcessLogTuple, Relay, TupleFormatError, TupleSpaceServer, TupleType

Constant Summary collapse

TUPLE =

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.

tuple type table

Hash.new

Class Method Summary collapse

Class Method Details

.[](identifier) ⇒ Class

Returns a tuple class corresponding to a tuple identifier.

Returns:

  • (Class)

    tuple class



271
272
273
# File 'lib/pione/tuple-space/basic-tuple.rb', line 271

def [](identifier)
  TUPLE[identifier]
end

.from_array(ary) ⇒ TupleObject

Return a tuple data object converted from an array.

Returns:

  • (TupleObject)

    tuple object

Raises:



285
286
287
288
289
290
291
292
293
# File 'lib/pione/tuple-space/basic-tuple.rb', line 285

def from_array(ary)
  raise TupleFormatError.new(ary) unless ary.size > 0
  raise TupleFormatError.new(ary) unless ary.respond_to?(:to_a)
  _ary = ary.to_a
  identifier = _ary.first
  raise TupleFormatError.new(identifier) unless TUPLE.has_key?(identifier)
  args = _ary[1..-1]
  TUPLE[identifier].new(*args)
end

.identifiersArray<Symbol>

Returns identifiers.

Returns:

  • (Array<Symbol>)

    all tuple identifiers in PIONE system.



278
279
280
# File 'lib/pione/tuple-space/basic-tuple.rb', line 278

def identifiers
  TUPLE.keys
end