class Reflekt::Meta

Public Class Methods

deserialize(meta) click to toggle source

Deserialize metadata.

TODO: Deserialize should create a Meta object. TODO: Require each Meta type to handle its own deserialization.

@param meta [Hash] The metadata to deserialize. @param meta [Hash]

# File lib/meta.rb, line 53
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
new() click to toggle source

Each meta defines its type.

# File lib/meta.rb, line 19
def initialize()
  @type = :null
end
numeric?(value) click to toggle source
# File lib/meta.rb, line 70
def self.numeric? value
  Float(value) != nil rescue false
end

Public Instance Methods

load(value) click to toggle source

Each meta loads values.

@param value [Dynamic]

# File lib/meta.rb, line 28
def load(value)
end
serialize() click to toggle source

@return [Hash]

# File lib/meta.rb, line 34
def serialize()
  {
    :type => @type
  }
end