Class: EA::AreaLookup::Coordinates

Inherits:
Object
  • Object
show all
Defined in:
lib/ea/area_lookup/coordinates.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(easting:, northing:) ⇒ Coordinates

Returns a new instance of Coordinates.



8
9
10
11
# File 'lib/ea/area_lookup/coordinates.rb', line 8

def initialize(easting:, northing:)
  @easting = easting
  @northing = northing
end

Instance Attribute Details

#eastingObject Also known as: x

Returns the value of attribute easting.



4
5
6
# File 'lib/ea/area_lookup/coordinates.rb', line 4

def easting
  @easting
end

#northingObject Also known as: y

Returns the value of attribute northing.



4
5
6
# File 'lib/ea/area_lookup/coordinates.rb', line 4

def northing
  @northing
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/ea/area_lookup/coordinates.rb', line 13

def valid?
  easting && northing
end