class Ardm::Property::String

Constants

DEFAULT_LENGTH

Public Class Methods

new(model, name, options = {}) click to toggle source
Calls superclass method Ardm::Property::new
# File lib/ardm/property/string.rb, line 33
def initialize(model, name, options = {})
  super
  @length = @options.fetch(:length)
end

Public Instance Methods

length() click to toggle source

Returns maximum property length (if applicable). This usually only makes sense when property is of type Range or custom

@return [Integer, nil]

the maximum length of this property

@api semipublic

# File lib/ardm/property/string.rb, line 23
def length
  if @length.kind_of?(Range)
    @length.max
  else
    @length
  end
end