Class: Meta

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

Overview

Metadata for input and output.

See Also:

  • for each meta.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMeta

Each meta defines its type.



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

def initialize()
  @type = :null
end

Class Method Details

.deserialize(meta) ⇒ Object

TODO:

Deserialize should create a Meta object.

TODO:

Require each Meta type to handle its own deserialization.

Deserialize metadata.

Parameters:

  • meta (Hash)

    The metadata to deserialize.

  • meta (Hash)


52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/meta.rb', line 52

def self.deserialize(meta)

  # Convert nil meta into NullMeta.
  # Meta is nil when there are no @inputs or @output on the method.
  if meta.nil?
    return NullMeta.new().serialize()
  end

  # Symbolize keys.
  # TODO: Remove once "Fix Rowdb.get(path)" bug fixed.
  meta = meta.transform_keys(&:to_sym)

  # Symbolize type value.
  meta[:type] = meta[:type].to_sym

  return meta

end

Instance Method Details

#load(value) ⇒ Object

Each meta loads values.

Parameters:

  • value (Dynamic)


27
28
# File 'lib/meta.rb', line 27

def load(value)
end

#serializeHash

Returns:

  • (Hash)


33
34
35
36
37
# File 'lib/meta.rb', line 33

def serialize()
  {
    :type => @type
  }
end