Sha256: 331c05ef918c0407fe2a35e208ebe44d5d9f37f3f1c524a03f235911cd68e539

Contents?: true

Size: 493 Bytes

Versions: 7

Compression:

Stored size: 493 Bytes

Contents

# frozen_string_literal: true

module Acfs::Resource::Attributes
  # @api public
  #
  # String attribute type. Use it in your model as
  # an attribute type:
  #
  # @example
  #   class User < Acfs::Resource
  #     attribute :name, :string
  #   end
  #
  class String < Base
    # @api public
    #
    # Cast given object to string.
    #
    # @param [Object] value Object to cast.
    # @return [String] Casted string.
    #
    def cast_value(value)
      value.to_s
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
acfs-2.0.0 lib/acfs/resource/attributes/string.rb
acfs-1.7.0 lib/acfs/resource/attributes/string.rb
acfs-1.6.0 lib/acfs/resource/attributes/string.rb
acfs-1.5.1 lib/acfs/resource/attributes/string.rb
acfs-1.5.0 lib/acfs/resource/attributes/string.rb
acfs-1.4.0 lib/acfs/resource/attributes/string.rb
acfs-1.3.4 lib/acfs/resource/attributes/string.rb