Sha256: d6c81317fa13ace777743e60a0b2e41298cd96e1811222473968dfc187a0bf96

Contents?: true

Size: 867 Bytes

Versions: 2

Compression:

Stored size: 867 Bytes

Contents

# frozen_string_literal: true

module KepplerFrontend
  module LiveEditor
    # Activate
    class Editor
      def initialize(data)
        @data = data
      end

      def live_editor_render
        {
          view_id: @data[:view_id],
          view_name: @data[:view_name],
          css_style: css.output,
          images_assets: images.output,
          components: components.output
        }
      end

      def live_editor_save(html_code, css_code)
        html.save(html_code)
        css.save(css_code)
        true
      rescue StandardError
        false
      end

      private

      def html
        HtmlHandler.new(@data[:view_name])
      end

      def css
        CssHandler.new(@data[:view_name])
      end

      def images
        ImagesHandler.new
      end

      def components
        ComponentsHandler.new
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
keppler-2.1.6 installer/core/rockets/keppler_frontend/app/services/keppler_frontend/live_editor/editor.rb
keppler-2.1.5 installer/core/rockets/keppler_frontend/app/services/keppler_frontend/live_editor/editor.rb