This file contains hidden or 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 Employee | |
def initialize(name, base_salary) | |
@name = name | |
@base_salary = base_salary | |
end | |
def calculate_net_salary | |
# business logic about how to calculate the net salary | |
end | |
This file contains hidden or 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 Employee | |
def initialize(name, base_salary) | |
@name = name | |
@base_salary = base_salary | |
end | |
def calculate_net_salary | |
# business logic about how to calculate the net salary | |
end | |
end |
This file contains hidden or 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 Notification | |
def initialze(kind, body) | |
@kind, @body = kind, body | |
end | |
def send_sms_notification | |
# sends a sms notification | |
end | |
def send_email_notification |
This file contains hidden or 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 SMSNotification < Notification | |
def send | |
# sends a sms notification | |
end | |
end | |
class EmailNotification < Notification | |
def send | |
# sends an email with the notification | |
end |
This file contains hidden or 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 Message | |
attr_reader :status | |
def initialize | |
@status = :started | |
end | |
def cancel | |
@status = :canceled | |
end |
This file contains hidden or 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 Message | |
attr_reader :status | |
def initialize | |
@status = :started | |
end | |
def can_be_cancelled? | |
return true | |
end |
This file contains hidden or 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
module Tools | |
def valid_email? email | |
# ... | |
end | |
def send_email(from, to, message) | |
# | |
end | |
def log(priority, message) |
This file contains hidden or 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
module Tools | |
module Mailer | |
def valid_email? email | |
# ... | |
end | |
def send_email(from, to, message) | |
# | |
end | |
end |
This file contains hidden or 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 Something | |
def initialize() | |
@variable = AnotherThing.new | |
end | |
end |
This file contains hidden or 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 Something | |
def initialize(a_thing) | |
@variable = a_thing | |
end | |
end |