Module: AdminScript::TypeAttributes

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
lib/admin_script/type_attributes.rb

Overview

Define method to cast value

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.cast_value(cast_type, value) ⇒ Object



27
28
29
# File 'lib/admin_script/type_attributes.rb', line 27

def self.cast_value(cast_type, value)
  ActiveModel::Type.lookup(cast_type).cast(value)
end