Class: Acfs::Resource::Attributes::String

Inherits:
Base
  • Object
show all
Defined in:
lib/acfs/resource/attributes/string.rb

Overview

String attribute type. Use it in your model as an attribute type:

Examples:

class User < Acfs::Resource
  attribute :name, :string
end

Instance Attribute Summary

Attributes inherited from Base

#default

Instance Method Summary collapse

Methods inherited from Base

#cast, #default_value, #initialize

Constructor Details

This class inherits a constructor from Acfs::Resource::Attributes::Base

Instance Method Details

#cast_value(value) ⇒ String

Cast given object to string.

Parameters:

  • value (Object)

    Object to cast.

Returns:



22
23
24
# File 'lib/acfs/resource/attributes/string.rb', line 22

def cast_value(value)
  value.to_s
end