lib/output_attributes.rb
# Return a hash representing your outputs
Return a hash representing your outputs
Return a hash representing your outputs
def output_attributes
    self.class.registered_output_attributes.map do |key, meth|
      value = case meth
      when Symbol, String
        self.send(meth.to_sym)
      when Proc
        meth.call(self)
      else
        raise ArgumentError, "Could not determine how to output #{meth} for #{key}."
      end
      [key, value]
    end.to_h
  end
def output_attributes self . class . registered_output_attributes . map do | key , meth | value = case meth when Symbol , String self . send ( meth . to_sym ) when Proc meth . call ( self ) else raise ArgumentError , "Could not determine how to output #{meth} for #{key}." end [ key , value ] end . to_h end
Return a hash representing your outputs
Return a hash representing your outputs