class PseudoEntity::Randoms::RandomStreetNames

Public Class Methods

new(street_positions, street_names) click to toggle source
Calls superclass method
# File lib/pseudo_entity/randoms.rb, line 860
def initialize(street_positions, street_names)
  super(street_positions, street_names)
end

Public Instance Methods

fetch(x) click to toggle source
Calls superclass method
# File lib/pseudo_entity/randoms.rb, line 864
def fetch(x)
  street = super(x)
  # Slightly increase the likelihood of a repetition by preventing silly names like "SE Main Street North"
  if ["North", "South", "East", "West"].any? { |x| street.last.include?(x) }
    street.last
  else
    street.join(' ')
  end
end