module SvelteOnRails::ActiveRecordExtensions

def to_svelte(*attributes, **associations)

Returns a hash of attributes, methods, and associations formatted for Svelte components
def to_svelte(*attributes, **associations)
  @to_svelte ||= begin
                   cl = SvelteOnRails::Lib::SvelteAttributes
                   r = cl.new.calculate_instance(self, attributes, associations)
                   r.first.merge({self.class.to_s.underscore => r[1]})
                 end
end