Sha256: 941e823c7a97fb40a154353de658ba1f2ead5528fa089f36d53c46f653d7eeb2

Contents?: true

Size: 495 Bytes

Versions: 1

Compression:

Stored size: 495 Bytes

Contents

module CloudSesame
  module Query
    module AST
      class DateValue < StringValue

        FORMAT = '%FT%TZ'.freeze

        def self.parse(value)
          range?(value) || string_range?(value) ? RangeValue.new(value, self) : new(value)
        end

        def to_s
          compile
        end

        private

        def recompile(value)
          super strip format value
        end

        def format(value)
          value.strftime FORMAT
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
CloudSesame-0.7.4 lib/cloud_sesame/query/ast/date_value.rb