Class: NormalizedTypes::String

Inherits:
ActiveModel::Type::String
  • Object
show all
Defined in:
lib/normalized_types/string.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#downcaseObject (readonly)

Returns the value of attribute downcase.



7
8
9
# File 'lib/normalized_types/string.rb', line 7

def downcase
  @downcase
end

#presenceObject (readonly)

Returns the value of attribute presence.



7
8
9
# File 'lib/normalized_types/string.rb', line 7

def presence
  @presence
end

#squishObject (readonly)

Returns the value of attribute squish.



7
8
9
# File 'lib/normalized_types/string.rb', line 7

def squish
  @squish
end

#stripObject (readonly)

Returns the value of attribute strip.



7
8
9
# File 'lib/normalized_types/string.rb', line 7

def strip
  @strip
end

#truncateObject (readonly)

Returns the value of attribute truncate.



7
8
9
# File 'lib/normalized_types/string.rb', line 7

def truncate
  @truncate
end