Class: NormalizedTypes::String
- Inherits:
-
ActiveModel::Type::String
- Object
- ActiveModel::Type::String
- NormalizedTypes::String
- Defined in:
- lib/normalized_types/string.rb
Instance Attribute Summary collapse
-
#downcase ⇒ Object
readonly
Returns the value of attribute downcase.
-
#presence ⇒ Object
readonly
Returns the value of attribute presence.
-
#squish ⇒ Object
readonly
Returns the value of attribute squish.
-
#strip ⇒ Object
readonly
Returns the value of attribute strip.
-
#truncate ⇒ Object
readonly
Returns the value of attribute truncate.
Instance Method Summary collapse
-
#initialize(strip: true, presence: true, squish: false, truncate: nil, downcase: false) ⇒ String
constructor
A new instance of String.
Constructor Details
#initialize(strip: true, presence: true, squish: false, truncate: nil, downcase: false) ⇒ String
Returns a new instance of String.
9 10 11 12 13 14 15 |
# File 'lib/normalized_types/string.rb', line 9 def initialize(strip: true, presence: true, squish: false, truncate: nil, downcase: false) @strip = strip @presence = presence @squish = squish @truncate = truncate @downcase = downcase end |
Instance Attribute Details
#downcase ⇒ Object (readonly)
Returns the value of attribute downcase.
7 8 9 |
# File 'lib/normalized_types/string.rb', line 7 def downcase @downcase end |
#presence ⇒ Object (readonly)
Returns the value of attribute presence.
7 8 9 |
# File 'lib/normalized_types/string.rb', line 7 def presence @presence end |
#squish ⇒ Object (readonly)
Returns the value of attribute squish.
7 8 9 |
# File 'lib/normalized_types/string.rb', line 7 def squish @squish end |
#strip ⇒ Object (readonly)
Returns the value of attribute strip.
7 8 9 |
# File 'lib/normalized_types/string.rb', line 7 def strip @strip end |
#truncate ⇒ Object (readonly)
Returns the value of attribute truncate.
7 8 9 |
# File 'lib/normalized_types/string.rb', line 7 def truncate @truncate end |