Class: PgArray

Inherits:
Object
  • Object
show all
Defined in:
lib/pg_array/pg_array.rb

Instance Method Summary collapse

Constructor Details

#initialize(pg_array_string) ⇒ PgArray

Returns a new instance of PgArray.



3
4
5
# File 'lib/pg_array/pg_array.rb', line 3

def initialize(pg_array_string)
  @pg_array_string = pg_array_string
end

Instance Method Details

#to_aObject



7
8
9
10
11
12
13
14
15
# File 'lib/pg_array/pg_array.rb', line 7

def to_a
  @to_a ||= begin
              if @pg_array_string.nil?
                nil
              else
                parse_array(@pg_array_string)
              end
            end
end