module Formattable
  extend ActiveSupport::Concern

  def format_attributes_with_values
    attribute_aliases.keys.index_with { |k| self[k] }
  end

  def hash_default(object=[], default=0, prop=false)
    object = public_send(object) if object.is_a? String
    object.index_with { |o| prop ? o.public_send(default) : default }
  end
end
