Created
March 27, 2013 17:11
-
-
Save julik/5256137 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
class OxMama | |
def path | |
end | |
end | |
class WyrwiGlaz < OxMama | |
def parent_path | |
'junk' | |
end | |
def node_id | |
'koshmar' | |
end | |
# Returns the result of the super call, or if it is nil | |
# the parent path, and also if the node_id is not nil as | |
# well as the parent path will return the parent path suffixed | |
# with the predicate in square brackets (maybe), because I already | |
# had too much acid anyway. who cares we do have tests. | |
# TODO: next coder after me please rewrite this junk. | |
def path | |
super||(p=parent_path)+(node_id&&p!=''?"[#{node_id}]":'') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment