module DHS::Record::CustomSetters

Private Instance Methods

apply_custom_setters!() click to toggle source
# File lib/dhs/concerns/record/custom_setters.rb, line 12
def apply_custom_setters!
  return if !_data.item? || !_data._raw.respond_to?(:keys)
  raw = _data._raw
  custom_setters = raw.keys.find_all { |key| public_methods.include?("#{key}=".to_sym) }
  custom_setters.each do |setter|
    value = raw.delete(setter)
    send("#{setter}=", value)
  end
end