Last active
January 2, 2016 14:39
-
-
Save cupakromer/8318170 to your computer and use it in GitHub Desktop.
Find outter most example group description
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
def top_level_description(e) | |
top_level(e)[:description] | |
end | |
def top_level_object(e) | |
top_level(e)[:description_args].first | |
end | |
# Finds the top level example group. | |
# By chance, this is actually the innner most nested | |
# example group. | |
def top_level_group(e) | |
group = e.metadata[:example_group] | |
group = group[:example_group] while group[:example_group] | |
group | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment