Class: Apicraft::Mocker::String
- Defined in:
- lib/apicraft/mocker/string.rb
Overview
Generate fake values for string data types
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Apicraft::Mocker::Base
Instance Method Details
#mock ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/apicraft/mocker/string.rb', line 7 def mock return enum.sample if enum.present? return Faker::Internet.email if format == "email" return Faker::Internet.url if format == "uri" return Faker::Internet.uuid if format == "uuid" return Faker::Time.backward.iso8601 if format == "date-time" Faker::Lorem.word end |