Sha256: f4add7004d07cf78494d320284f500520e9f9e9740b9cd31982c265e3be6dcad

Contents?: true

Size: 403 Bytes

Versions: 1

Compression:

Stored size: 403 Bytes

Contents

module Qrb
  module Syntax
    module NamedConstraint

      def compile(var_name)
        { constraint_name.to_sym => expression.compile(var_name) }
      end

      def to_ast(var_name)
        [ :constraint,
          constraint_name.to_s,
          [:fn, [:parameters, var_name], [:source, expression.to_s.strip]] ]
      end

    end # module NamedConstraint
  end # module Syntax
end # module Qrb

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
qrb-0.3.0 lib/qrb/syntax/named_constraint.rb