Module: TrailerVote::MediaTypes::Types

Defined in:
lib/trailer_vote/media_types/types/boolean.rb,
lib/trailer_vote/media_types/types/iso8601.rb,
lib/trailer_vote/media_types/types/uuid_v4.rb,
lib/trailer_vote/media_types/types/http_url.rb,
lib/trailer_vote/media_types/types/local_time.rb,
lib/trailer_vote/media_types/types/vote_value.rb,
lib/trailer_vote/media_types/types/formatted_url.rb,
lib/trailer_vote/media_types/types/product_data_type.rb,
lib/trailer_vote/media_types/types/product_image_type.rb,
lib/trailer_vote/media_types/types/product_movie_type.rb,
lib/trailer_vote/media_types/types/product_movie_handler.rb,
lib/trailer_vote/media_types/types/influx_db_connection_url.rb

Defined Under Namespace

Classes: FormattedUrl

Constant Summary collapse

Boolean =

noinspection RubyConstantNamingConvention

::MediaTypes::Scheme.AnyOf(
  TrueClass,
  FalseClass
)
Iso8601 =

noinspection RubyConstantNamingConvention

/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/
UuidV4 =

noinspection RubyConstantNamingConvention

/[A-z0-9]{8}-[A-z0-9]{4}-4[A-z0-9]{3}-[A-z0-9]{4}-[A-z0-9]{12}/
HttpUrl =

noinspection RubyConstantNamingConvention

mathiasbynens.be/demo/url-regex

RFC compliant for http, https and ftp: _^(?:(?:https?|ftp)://)(?:S+(?::S*)?@)?(?:(?!10(?:.d1,3)3)(?!127(?:.d1,3)3) (?!169.254(?:.d1,3)2)(?!192.168(?:.d1,3)2)(?!172.(?:1|2d|3)(?:.d1,3)2) (?:[1-9]d?|1dd|2d|22)(?:.(?:1?d1,2|2d|25))2(?:. (?:[1-9]d?|1dd|2d|25))|(?:(?:[a-zx00a1-xffff0-9]+-?)*)(?:. (?:[a-zx{00a1}-x{ffff}0-9]-?)*+)*(?:.(?:[a-zx00a1-xffff]2,)))(?::d2,5)? (?:/[^s]*)?$_iuS

The one used here actually passes all valid urls, but just doesn’t reject ALL invalid ones

%r{^https?:\/\/[^\s\/$.?#].[^\s]*$}
LocalTime =

noinspection RubyConstantNamingConvention |60 seconds notation needed to support leap second

/^(0[0-9]|1[0-9]|2[0-3]|[0-9]):([0-5][0-9]):([0-5][0-9]|60)$/
VoteValue =

noinspection RubyConstantNamingConvention

::MediaTypes::Scheme.AnyOf(
  'positive',
  'negative',
  'neutral',
  'skip'
)
ProductDataType =

noinspection RubyConstantNamingConvention

::MediaTypes::Scheme.AnyOf(
  'movie',
  'book'
)
ProductImageType =

noinspection RubyConstantNamingConvention

::MediaTypes::Scheme.AnyOf(
  'backdrop',
  'poster'
)
ProductImageTypeV1 =

noinspection RubyConstantNamingConvention

::MediaTypes::Scheme.AnyOf(
  'backdrop',
  'poster',
  'Poster',
  'HeroMobileDynamic',
  'PosterDynamic',
  'HeroDesktopDynamic'
)
ProductMovieType =

noinspection RubyConstantNamingConvention

::MediaTypes::Scheme.AnyOf(
  'Trailer',
  'Teaser',
  'Rewards',
  'Advert'
)
ProductMovieHandler =

noinspection RubyConstantNamingConvention

::MediaTypes::Scheme.AnyOf(
  'youtube',
  'vimeo',
  'url'
)
InfluxDbConnectionUrl =

noinspection RubyConstantNamingConvention

%r{^https?:\/\/[^\s\/$.?#].[^\s]*$}

Class Method Summary collapse

Class Method Details

.makeFormattedUrl(*variables) ⇒ Object

noinspection RubyInstanceMethodNamingConvention



46
47
48
# File 'lib/trailer_vote/media_types/types/formatted_url.rb', line 46

def makeFormattedUrl(*variables) # rubocop:disable Naming/MethodName
  FormattedUrl.new(*variables)
end