Sha256: 2f05b55c46f8f01e5a6e490067a0092e7f1b4dbd4f1b2e7a7f577a30311b925b

Contents?: true

Size: 456 Bytes

Versions: 4

Compression:

Stored size: 456 Bytes

Contents

class CfSim::Portal
  attr_reader :name, :latitude, :longitude

  def initialize(name, latitude, longitude)
    @name = name
    @latitude = latitude
    @longitude = longitude
  end

  def ==(other)
    eql?(other)
  end

  def eql?(other)
    @name == other.name && @latitude == other.latitude && @longitude == other.longitude
  end

  def hash
    @name.hash + @latitude + @longitude
  end

  def to_s
    "#{name}(#{latitude}, #{longitude})"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cf_sim-1.1.2 lib/cf_sim/portal.rb
cf_sim-1.1.1 lib/cf_sim/portal.rb
cf_sim-1.1.0 lib/cf_sim/portal.rb
cf_sim-1.0.0 lib/cf_sim/portal.rb