Class: Dynflow::Serializable

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

Constant Summary collapse

TIME_FORMAT =
'%Y-%m-%d %H:%M:%S.%L'
LEGACY_TIME_FORMAT =
'%Y-%m-%d %H:%M:%S'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.constantize(action_name) ⇒ Object



34
35
36
# File 'lib/dynflow/serializable.rb', line 34

def self.constantize(action_name)
  Utils.constantize(action_name)
end

.from_hash(hash, *args) ⇒ Object



8
9
10
11
# File 'lib/dynflow/serializable.rb', line 8

def self.from_hash(hash, *args)
  check_class_key_present hash
  constantize(hash[:class]).new_from_hash(hash, *args)
end

.new_from_hash(hash, *args) ⇒ Object

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.

Raises:

  • (NotImplementedError)


18
19
20
21
# File 'lib/dynflow/serializable.rb', line 18

def self.new_from_hash(hash, *args)
  raise NotImplementedError
  # new ...
end

Instance Method Details

#to_hashObject

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/dynflow/serializable.rb', line 13

def to_hash
  raise NotImplementedError
end