Class: Meta
- Inherits:
-
Object
- Object
- Meta
- Defined in:
- lib/Meta.rb
Overview
Metadata for input and output.
Direct Known Subclasses
ArrayMeta, BooleanMeta, FloatMeta, IntegerMeta, NullMeta, StringMeta
Class Method Summary collapse
-
.deserialize(meta) ⇒ Object
Deserialize metadata.
Instance Method Summary collapse
-
#initialize ⇒ Meta
constructor
Each meta defines its type.
-
#load(value) ⇒ Object
Each meta loads values.
-
#serialize ⇒ Hash
Each meta serializes metadata.
Constructor Details
#initialize ⇒ Meta
Each meta defines its type.
18 19 20 |
# File 'lib/Meta.rb', line 18 def initialize() @type = nil 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.
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() # Convert nil meta into NullMeta. # Meta is nil when there are no @inputs or @output on the method. if .nil? return NullMeta.new().serialize() end # Symbolize keys. # TODO: Remove once "Fix Rowdb.get(path)" bug fixed. = .transform_keys(&:to_sym) # Symbolize type value. [:type] = [:type].to_sym return end |
Instance Method Details
#load(value) ⇒ Object
Each meta loads values.
27 28 |
# File 'lib/Meta.rb', line 27 def load(value) end |
#serialize ⇒ Hash
Each meta serializes metadata.
35 36 37 |
# File 'lib/Meta.rb', line 35 def serialize() {} end |