Sha256: 637fbb59719f45f9629162449fef2db85db806e52af27610613874f073241deb

Contents?: true

Size: 438 Bytes

Versions: 3

Compression:

Stored size: 438 Bytes

Contents

module Livefyre
  class CursorValidator
    def self.validate(data)
      reason = ''

      reason += '\n Resource is null or blank' if data.resource.to_s.empty?
      reason += '\n Limit is null or blank' if data.limit.to_s.empty?
      reason += '\n Cursor time is null or blank' if data.cursor_time.to_s.empty?

      raise ArgumentError, "Problems with your cursor input: #{reason}" if reason.length > 0

      data
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
livefyre-2.0.2 lib/livefyre/validator/cursor_validator.rb
livefyre-2.0.1 lib/livefyre/validator/cursor_validator.rb
livefyre-2.0.0 lib/livefyre/validator/cursor_validator.rb