Sha256: f65372a2c5ce2045811aa8462f88eb5ddde4bed453bad6b337a7371010c64338

Contents?: true

Size: 496 Bytes

Versions: 9

Compression:

Stored size: 496 Bytes

Contents

module Fx
  # @api private
  class Trigger
    include Comparable

    attr_reader :name, :definition
    delegate :<=>, to: :name

    def initialize(function_row)
      @name = function_row.fetch("name")
      @definition = function_row.fetch("definition")
    end

    def ==(other)
      name == other.name && definition == other.definition
    end

    def to_schema
      <<-SCHEMA
  create_trigger :#{name}, sql_definition: <<-\SQL
      #{definition}
  SQL
      SCHEMA
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
fx-0.8.0 lib/fx/trigger.rb
fx-0.7.0 lib/fx/trigger.rb
fx-jets-0.6.3s lib/fx/trigger.rb
fx-0.6.2 lib/fx/trigger.rb
fx-0.6.1 lib/fx/trigger.rb
fx-0.6.0 lib/fx/trigger.rb
fx-0.5.0 lib/fx/trigger.rb
fx-0.4.0 lib/fx/trigger.rb
fx-0.3.1 lib/fx/trigger.rb