Sha256: fad8c37ff86fb6441ca5c097e66f6a52d33fc0f052c41ca2177b38e88b2658f3

Contents?: true

Size: 604 Bytes

Versions: 79

Compression:

Stored size: 604 Bytes

Contents

module OldSql
  module ReportDesign
    class CellData
      attr_accessor :data, :type
      
      COLUMN = 1
      LABEL = 2
      OPERATOR = 3
      NUMERIC_LITERAL = 4
      
      def initialize(value)
        @data = value
        set_type
      end
      
      private
      
      def set_type
        @type = case @data[0]
                when /['"]/
                  LABEL
                when /[\/*+-\Q()]/
                  OPERATOR
                when /[0-9]/
                  NUMERIC_LITERAL
                else
                  COLUMN
                end
      end
    end
  end
end

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
old_sql-1.65.0 lib/old_sql/report_design/cell_data.rb
old_sql-1.64.0 lib/old_sql/report_design/cell_data.rb
old_sql-1.63.0 lib/old_sql/report_design/cell_data.rb
old_sql-1.62.0 lib/old_sql/report_design/cell_data.rb
old_sql-1.61.0 lib/old_sql/report_design/cell_data.rb
old_sql-1.60.0 lib/old_sql/report_design/cell_data.rb
old_sql-1.59.0 lib/old_sql/report_design/cell_data.rb
old_sql-1.58.0 lib/old_sql/report_design/cell_data.rb
old_sql-1.57.0 lib/old_sql/report_design/cell_data.rb
old_sql-1.56.0 lib/old_sql/report_design/cell_data.rb
old_sql-1.55.0 lib/old_sql/report_design/cell_data.rb
old_sql-1.54.0 lib/old_sql/report_design/cell_data.rb
old_sql-1.53.0 lib/old_sql/report_design/cell_data.rb
old_sql-1.52.0 lib/old_sql/report_design/cell_data.rb
old_sql-1.51.0 lib/old_sql/report_design/cell_data.rb
old_sql-1.50.0 lib/old_sql/report_design/cell_data.rb
old_sql-1.49.0 lib/old_sql/report_design/cell_data.rb
old_sql-1.48.0 lib/old_sql/report_design/cell_data.rb
old_sql-1.47.0 lib/old_sql/report_design/cell_data.rb
old_sql-1.46.0 lib/old_sql/report_design/cell_data.rb