Method: ShellCardManagementApIs::InvoiceDistributionMethod.from_hash
- Defined in:
- lib/shell_card_management_ap_is/models/invoice_distribution_method.rb
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/shell_card_management_ap_is/models/invoice_distribution_method.rb', line 80 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. is_primary = hash['IsPrimary'] ||= true frequency_type = hash.key?('FrequencyType') ? hash['FrequencyType'] : SKIP distribution_method = hash.key?('DistributionMethod') ? hash['DistributionMethod'] : SKIP output_type = hash.key?('OutputType') ? hash['OutputType'] : SKIP # Create object from extracted values. InvoiceDistributionMethod.new(is_primary, frequency_type, distribution_method, output_type) end |