Class: Torque::PostgreSQL::Box

Inherits:
Struct
  • Object
show all
Defined in:
lib/torque/postgresql/adapter/oid/box.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#x1Object

Returns the value of attribute x1

Returns:

  • (Object)

    the current value of x1



5
6
7
# File 'lib/torque/postgresql/adapter/oid/box.rb', line 5

def x1
  @x1
end

#x2Object

Returns the value of attribute x2

Returns:

  • (Object)

    the current value of x2



5
6
7
# File 'lib/torque/postgresql/adapter/oid/box.rb', line 5

def x2
  @x2
end

#y1Object

Returns the value of attribute y1

Returns:

  • (Object)

    the current value of y1



5
6
7
# File 'lib/torque/postgresql/adapter/oid/box.rb', line 5

def y1
  @y1
end

#y2Object

Returns the value of attribute y2

Returns:

  • (Object)

    the current value of y2



5
6
7
# File 'lib/torque/postgresql/adapter/oid/box.rb', line 5

def y2
  @y2
end

Instance Method Details

#pointsObject



6
7
8
9
10
11
12
13
14
# File 'lib/torque/postgresql/adapter/oid/box.rb', line 6

def points
  klass = Torque::PostgreSQL.config.geometry.point_class
  [
    klass.new(x1, y1),
    klass.new(x1, y2),
    klass.new(x2, y1),
    klass.new(x2, y2),
  ]
end