Sha256: d4cc6d6625996953ec0cf05f3c01915a8ebcd13abbfff923ca6b5e1aed9596d1

Contents?: true

Size: 498 Bytes

Versions: 2

Compression:

Stored size: 498 Bytes

Contents

# frozen_string_literal: true

module TableSaw
  module DependencyGraph
    class AddDirective
      attr_reader :table_name, :partial
      attr_accessor :ids

      def initialize(table_name, ids: [], partial: true)
        @table_name = table_name
        @ids = ids
        @partial = partial
      end

      alias partial? partial

      def selectable?
        partial? && Array(ids).size.positive?
      end

      def queryable?
        !partial || selectable?
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
table_saw-0.5.0 lib/table_saw/dependency_graph/add_directive.rb
table_saw-0.4.0 lib/table_saw/dependency_graph/add_directive.rb