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
interface IEmployee extends Feedable, Workable { | |
} | |
interface IWorkable { | |
public void work(); | |
} | |
interface IFeedable{ | |
public void eat(); | |
} |
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
interface IEmployee { | |
public void work(); | |
public void eat(); | |
} | |
class Employee implements IEmployee{ | |
public void work() { | |
} | |
public void eat() { | |
// ...... eating in launch break |
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 Something | |
def initialize(a_thing) | |
@variable = a_thing | |
end | |
end |
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 Something | |
def initialize() | |
@variable = AnotherThing.new | |
end | |
end |
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
module Tools | |
module Mailer | |
def valid_email? email | |
# ... | |
end | |
def send_email(from, to, message) | |
# | |
end | |
end |
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
module Tools | |
def valid_email? email | |
# ... | |
end | |
def send_email(from, to, message) | |
# | |
end | |
def log(priority, message) |
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 Message | |
attr_reader :status | |
def initialize | |
@status = :started | |
end | |
def can_be_cancelled? | |
return true | |
end |
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 Message | |
attr_reader :status | |
def initialize | |
@status = :started | |
end | |
def cancel | |
@status = :canceled | |
end |
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 SMSNotification < Notification | |
def send | |
# sends a sms notification | |
end | |
end | |
class EmailNotification < Notification | |
def send | |
# sends an email with the notification | |
end |
NewerOlder