Created
March 13, 2018 02:24
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Mailman | |
attr_reader :latitude_s, :longitude_s, :mjma, :depth | |
def initialize(latitude_s, longitude_s, mjma, depth) | |
@latitude_s = latitude_s | |
@longitude_s = longitude_s | |
@mjma = mjma | |
@depth = depth | |
@users = [] | |
end | |
def notify_to_user | |
@users.each do |user| | |
user.update(self) | |
end | |
end | |
def add_user(user) | |
@users << user | |
end | |
def delete_user(user) | |
@users.delete(user) | |
end | |
private | |
def alert | |
@user.alert(self) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment