Sha256: dfc9c4e7b0b06baad7a0bcd52a4a8c3fad20d874057940d1cdc7c294654bdfa7

Contents?: true

Size: 562 Bytes

Versions: 11

Compression:

Stored size: 562 Bytes

Contents

module Restspec::Schema::Types
  class StringType < BasicType
    # Generates a random word.
    #
    # @param attribute [Restspec::Schema::Attribute] the atribute of the schema.
    #
    # @return [String] A random word.
    def example_for(attribute)
      Faker::Lorem.word
    end

    # @param attribute [Restspec::Schema::Attribute] the atribute of the schema.
    # @param value [Object] the value of the attribute.
    #
    # @return [true, false] If the value is a string.
    def valid?(attribute, value)
      value.is_a?(String)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
restspec-0.3.2 lib/restspec/schema/types/string_type.rb
restspec-0.3.1 lib/restspec/schema/types/string_type.rb
restspec-0.3.0 lib/restspec/schema/types/string_type.rb
restspec-0.2.6 lib/restspec/schema/types/string_type.rb
restspec-0.2.5 lib/restspec/schema/types/string_type.rb
restspec-0.2.4 lib/restspec/schema/types/string_type.rb
restspec-0.2.3 lib/restspec/schema/types/string_type.rb
restspec-0.2.2 lib/restspec/schema/types/string_type.rb
restspec-0.2.1 lib/restspec/schema/types/string_type.rb
restspec-0.2 lib/restspec/schema/types/string_type.rb
restspec-0.1 lib/restspec/schema/types/string_type.rb