Class: DataMapper::Property::StringArray
- Defined in:
- lib/dm-pg-types/string_array.rb
Constant Summary collapse
- DEFAULT_LENGTH =
50
Instance Method Summary collapse
-
#initialize(model, name, options = {}) ⇒ StringArray
constructor
A new instance of StringArray.
- #length ⇒ Object
Methods inherited from PgArray
Constructor Details
#initialize(model, name, options = {}) ⇒ StringArray
Returns a new instance of StringArray.
19 20 21 22 |
# File 'lib/dm-pg-types/string_array.rb', line 19 def initialize(model, name, = {}) super @length = @options.fetch(:length) end |
Instance Method Details
#length ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/dm-pg-types/string_array.rb', line 11 def length if @length.kind_of?(Range) @length.max else @length end end |