Sha256: 72b84e0fb36634b035a6743f52d176db67f58c95e34919b89392fce129b9ed15

Contents?: true

Size: 586 Bytes

Versions: 2

Compression:

Stored size: 586 Bytes

Contents

module Piglet
  module Field
    class PrefixExpression # :nodoc:
      include Field
    
      def initialize(operator, expression, space_between=true, options=nil)
        options ||= {}
        @operator, @expression, @space_between = operator, expression, space_between
        @type = options[:type] || expression.type
      end
    
      def simple?
        true
      end
    
      def to_s
        if @space_between
          "#{@operator} #{parenthesise(@expression)}"
        else
          "#{@operator}#{parenthesise(@expression)}"
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
piglet-0.2.2 lib/piglet/field/prefix_expression.rb
piglet-0.2.0 lib/piglet/field/prefix_expression.rb