Sha256: 1312fe683f19c92e5b55b850373bd6bb427ba971cc2781885c49db15b2867272

Contents?: true

Size: 455 Bytes

Versions: 5

Compression:

Stored size: 455 Bytes

Contents

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] obj Object to cast.
    # @return [String] Casted string.
    #
    def cast_type(obj)
      obj.to_s
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
acfs-0.45.0 lib/acfs/resource/attributes/string.rb
acfs-0.44.0 lib/acfs/resource/attributes/string.rb
acfs-0.43.2 lib/acfs/resource/attributes/string.rb
acfs-0.43.1 lib/acfs/resource/attributes/string.rb
acfs-0.43.0 lib/acfs/resource/attributes/string.rb