Last active
August 29, 2015 14:25
-
-
Save ewilazarus/e90c51380d196c98f5f4 to your computer and use it in GitHub Desktop.
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
public class Markuper | |
{ | |
public virtual string execute(string content) | |
{ | |
return content; | |
} | |
} | |
public class H1Markuper : Markuper | |
{ | |
public string execute(string content) | |
{ | |
return "<h1>" + super.execute(content) + "</h1>"; | |
} | |
} | |
public class PMarkuper : Markuper | |
{ | |
public string execute(string content) | |
{ | |
return "<p>" + super.execute(content) + "</p>"; | |
} | |
} | |
public class Program | |
{ | |
var h1Markuper = new H1Markuper(); | |
Console.WriteLine(h1Markuper.execute("This is my header")); | |
// <h1>This is my header</h1> | |
var pMarkuper = new PMarkuper(); | |
Console.WriteLine(pMarkuper.execute("This is my paragraph")); | |
// <p>This is my paragraph</p> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment