Class: Restspec::Schema::Types::StringType
- Defined in:
- lib/restspec/schema/types/string_type.rb
Instance Method Summary collapse
-
#example_for(attribute) ⇒ String
Generates a random word.
-
#valid?(attribute, value) ⇒ true, false
If the value is a string.
Methods inherited from BasicType
#initialize, #of, #to_s, #totally_valid?, #|
Constructor Details
This class inherits a constructor from Restspec::Schema::Types::BasicType
Instance Method Details
#example_for(attribute) ⇒ String
Generates a random word.
8 9 10 |
# File 'lib/restspec/schema/types/string_type.rb', line 8 def example_for(attribute) Faker::Lorem.word end |
#valid?(attribute, value) ⇒ true, false
Returns If the value is a string.
16 17 18 |
# File 'lib/restspec/schema/types/string_type.rb', line 16 def valid?(attribute, value) value.is_a?(String) end |