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-4.1.1 lib/urbanairship/util.rb
urbanairship-4.1.0 lib/urbanairship/util.rb
urbanairship-4.0.0 lib/urbanairship/util.rb
urbanairship-3.2.4 lib/urbanairship/util.rb
urbanairship-3.2.3 lib/urbanairship/util.rb
urbanairship-3.2.2 lib/urbanairship/util.rb
urbanairship-3.2.1 lib/urbanairship/util.rb
urbanairship-3.2.0 lib/urbanairship/util.rb
urbanairship-3.1.1 lib/urbanairship/util.rb
urbanairship-3.1.0 lib/urbanairship/util.rb
urbanairship-3.0.2 lib/urbanairship/util.rb
urbanairship-3.0.1 lib/urbanairship/util.rb