Class: DynamicFields::Attribute
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- DynamicFields::Attribute
- Defined in:
- app/models/dynamic_fields/attribute.rb
Direct Known Subclasses
Defined Under Namespace
Classes: BooleanAttribute, IntegerAttribute, StringAttribute
Constant Summary collapse
- DEFAULT_FIELD_TYPE =
:string
- AVAILABLE_ATTRIBUTE_TYPES =
%i[ string boolean integer ].freeze
Class Method Summary collapse
Class Method Details
.attribute_class_for_attribute_type(attribute_type) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'app/models/dynamic_fields/attribute.rb', line 17 def attribute_class_for_attribute_type(attribute_type) case attribute_type when :string return "DynamicFields::Attribute::StringAttribute" when :integer return "DynamicFields::Attribute::IntegerAttribute" when :boolean return "DynamicFields::Attribute::BooleanAttribute" end end |