Class: MarkupAttributes::MarkupType
- Inherits:
-
ActiveRecord::Type::String
- Object
- ActiveRecord::Type::String
- MarkupAttributes::MarkupType
- Defined in:
- lib/markup_attributes.rb
Overview
The type used by ActiveRecord’s attributes API
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.inspect ⇒ Object
48 49 50 |
# File 'lib/markup_attributes.rb', line 48 def self.inspect "<MarkupType [#{}]>" end |
Instance Method Details
#cast(value) ⇒ Object
54 55 56 57 58 59 60 |
# File 'lib/markup_attributes.rb', line 54 def cast(value) if value.is_a?(String) || value.is_a?(MarkupString) MarkupString.new(value).tap { |s| s. = self. } else super end end |