Class: Dynflow::Serializable

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.constantize(action_name) ⇒ Object



29
30
31
# File 'lib/dynflow/serializable.rb', line 29

def self.constantize(action_name)
  action_name.constantize
end

.from_hash(hash, *args) ⇒ Object



3
4
5
6
# File 'lib/dynflow/serializable.rb', line 3

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)


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

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

Instance Method Details

#to_hashObject

Raises:

  • (NotImplementedError)


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

def to_hash
  raise NotImplementedError
end