Sha256: 427167723f380751fce021866455cdbd70c423a15d9f1dd37f2b0fbcc37efb2c

Contents?: true

Size: 590 Bytes

Versions: 4

Compression:

Stored size: 590 Bytes

Contents

# frozen_string_literal: true

module Segmentor
  # Source runs the code and returns an array of ::Segmentor::Target
  # you can dervie from this for different types of code sources (ie Ruby, JS, etc)
  class Source < ActiveRecord::Base
    self.table_name = 'segmentor_sources'

    belongs_to :segment, class_name: '::Segmentor::Segment', foreign_key: :segment_id

    validates :code, presence: true
    validates :type, presence: true
    validates :segment, presence: true

    def execute
      raise NotImplementedError, 'execute must be implemented in a subclass'
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
segmentor-0.0.2.3 lib/segmentor/source.rb
segmentor-0.0.2.2 lib/segmentor/source.rb
segmentor-0.0.2.1 lib/segmentor/source.rb
segmentor-0.0.1 lib/segmentor/source.rb