Class: Synthra::Types::TechnologyInternet::MimeType

Inherits:
Base
  • Object
show all
Defined in:
lib/synthra/types/technology_internet/formats.rb

Overview

MimeType type

Constant Summary collapse

MIME_TYPES =
[
  "text/plain", "text/html", "text/css", "text/javascript",
  "application/json", "application/xml", "application/pdf",
  "image/jpeg", "image/png", "image/gif", "image/svg+xml",
  "video/mp4", "video/quicktime", "audio/mpeg", "audio/wav"
].freeze

Instance Method Summary collapse

Instance Method Details

#generate_edge(rng, context, args) ⇒ Object



56
57
58
# File 'lib/synthra/types/technology_internet/formats.rb', line 56

def generate_edge(rng, context, args)
  ["", "text/plain", "application/json"].sample(random: rng.instance_variable_get(:@random))
end

#generate_invalid(rng, context, args) ⇒ Object



60
61
62
# File 'lib/synthra/types/technology_internet/formats.rb', line 60

def generate_invalid(rng, context, args)
  [nil, 123, [], {}].sample(random: rng.instance_variable_get(:@random))
end

#generate_random(rng, context, args) ⇒ Object



52
53
54
# File 'lib/synthra/types/technology_internet/formats.rb', line 52

def generate_random(rng, context, args)
  rng.sample(MIME_TYPES)
end