Method: Asdawqw::CancellationPolicy.from_hash

Defined in:
lib/asdawqw/models/cancellation_policy.rb

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/asdawqw/models/cancellation_policy.rb', line 32

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.

  type = hash['type']
  manual_policy = ManualPolicy.from_hash(hash['manualPolicy']) if
    hash['manualPolicy']

  # Create object from extracted values.

  CancellationPolicy.new(type,
                         manual_policy)
end