Sha256: 466b4ba2eddd38364a744bd43371eae7f0288f59458c4929e6d4805b1f687bab

Contents?: true

Size: 525 Bytes

Versions: 2

Compression:

Stored size: 525 Bytes

Contents

require 'yaml'

module CriteriaOperator
  module UiComponent
    class CriteriaEditorCell < BaseCell

      def show
        render
      end

      def choose_template(options = {})
        if model.kind_of? BinaryOperator
          ExpressionCell.call(model).call(:show, options)
        else
          GroupCell.call(model).call(:show, options)
        end
      end

      private

      def serialized_operator
        YAML.dump(model) if model.is_a? BaseOperator
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
criteria_operator-ui_component-0.2.1 app/cells/criteria_operator/ui_component/criteria_editor_cell.rb
criteria_operator-ui_component-0.2.0 app/cells/criteria_operator/ui_component/criteria_editor_cell.rb