<commit_before># encoding: utf-8

module CartoDB
  module Visualization
    class Presenter
      def initialize(visualization)
        @visualization = visualization
      end #initialize

      def to_poro
        {
          id:               visualization.id,
          name:             visualization.name,
          map_id:           visualization.map_id,
          active_layer_id:  visualization.active_layer_id,
          type:             visualization.type,
          tags:             visualization.tags,
          description:      visualization.description,
          privacy:          visualization.privacy.upcase,
          table:            table_data_for(visualization.table),
          related_tables:   related_tables,
          stats:            visualization.stats
        }
      end #to_poro

      private

      attr_reader :visualization

      def table_data_for(table=nil)
        return {} unless table
        {
          id:               table.id,
          name:             table.name,
          privacy:          table.privacy_text,
          size:             table.table_size,<commit_msg>return created at in visualization presenter<commit_after># encoding: utf-8

module CartoDB
  module Visualization
    class Presenter
      def initialize(visualization)
        @visualization = visualization
      end #initialize

      def to_poro
        {
          id:               visualization.id,
          name:             visualization.name,
          map_id:           visualization.map_id,
          active_layer_id:  visualization.active_layer_id,
          type:             visualization.type,
          tags:             visualization.tags,
          description:      visualization.description,
          privacy:          visualization.privacy.upcase,
          table:            table_data_for(visualization.table),
          related_tables:   related_tables,
          stats:            visualization.stats,
          created_at:       visualization.created_at,
          updated_at:       visualization.updated_at
        }
      end #to_poro

      private

      attr_reader :visualization

      def table_data_for(table=nil)
        return {} unless table
        {
          id:               table.id,
          name:             table.name,
          privacy:          table.privacy_text,
          size:             table.table_size,
{'fraction_non_alphanumeric': 0.05855290673358427, 'fraction_numerical': 0.000836470096194061, 'mean_word_length': 1.4508196721311475, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4424176', 'n_tokens_mistral': 608, 'n_tokens_neox': 592, 'n_words': 122}