Sha256: 9caa88a233ceaac199891cb9e1a09eb6ab0509186300d54632d61555fd004a2b

Contents?: true

Size: 399 Bytes

Versions: 32

Compression:

Stored size: 399 Bytes

Contents

module Urbanairship
  module Util
    module_function

    # @raise [ArgumentError] unless obj matches the pattern.
    def validate(obj, name, regex)
      fail ArgumentError, "#{obj} isn't a valid #{name}" unless obj =~ regex
    end

    # @return [String] the datetime formatted as expected by the API
    def time_format(datetime)
      datetime.strftime('%Y-%m-%dT%H:%M:%S')
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
urbanairship-9.2.0 lib/urbanairship/util.rb
urbanairship-9.1.1 lib/urbanairship/util.rb
urbanairship-9.1.0 lib/urbanairship/util.rb
urbanairship-9.0.0 lib/urbanairship/util.rb
urbanairship-8.0.1 lib/urbanairship/util.rb
urbanairship-8.0.0 lib/urbanairship/util.rb
urbanairship-7.0.0 lib/urbanairship/util.rb
urbanairship-6.0.0 lib/urbanairship/util.rb
urbanairship-5.9.0 lib/urbanairship/util.rb
urbanairship-5.8.0 lib/urbanairship/util.rb
urbanairship-5.7.0 lib/urbanairship/util.rb
urbanairship-5.6.1 lib/urbanairship/util.rb
urbanairship-5.6.0 lib/urbanairship/util.rb
urbanairship-5.5.1 lib/urbanairship/util.rb
urbanairship-5.5.0 lib/urbanairship/util.rb
urbanairship-5.4.0 lib/urbanairship/util.rb
urbanairship-5.3.0 lib/urbanairship/util.rb
urbanairship-5.2.0 lib/urbanairship/util.rb
urbanairship-5.0.1 lib/urbanairship/util.rb
urbanairship-5.0.0 lib/urbanairship/util.rb