# File lib/arjdbc/postgresql/base/oid.rb, line 161 def extract_bounds(value) from, to = value[1..-2].split(',') { from: (value[1] == ',' || from == '-infinity') ? @subtype.infinity(negative: true) : from, to: (value[-2] == ',' || to == 'infinity') ? @subtype.infinity : to, exclude_start: (value[0] == '('), exclude_end: (value[-1] == ')') } end
# File lib/arjdbc/postgresql/base/oid.rb, line 171 def infinity?(value) value.respond_to?(:infinite?) && value.infinite? end
# File lib/arjdbc/postgresql/base/oid.rb, line 155 def simplified_type(sql_type); sql_type.to_sym end
# File lib/arjdbc/postgresql/base/oid.rb, line 179 def type_cast(value) return if value.nil? || value == 'empty' return value if value.is_a?(::Range) extracted = extract_bounds(value) from = type_cast_single extracted[:from] to = type_cast_single extracted[:to] if !infinity?(from) && extracted[:exclude_start] if from.respond_to?(:succ) from = from.succ ActiveSupport::Deprecation.warn Excluding the beginning of a Range is only partialy supported through `#succ`.This is not reliable and will be removed in the future. else raise ArgumentError, "The Ruby Range object does not support excluding the beginning of a Range. (unsupported value: '#{value}')" end end ::Range.new(from, to, extracted[:exclude_end]) end
Generated with the Darkfish Rdoc Generator 2.