Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "title" => "The Dream of %{author}'s %{pet}",
- "author" => "%{authorFirst} %{authorLast}",
- "authorFirst" => "Jim",
- "authorLast" => "Bo",
- "pet" => "cat"
- }
- Passing the above function in, the first run through would yield:
- {
- "title" => "The Dream of %{author}'s %{pet}",
- "author" => "Jim Bo",
- "authorFirst" => "Jim",
- "authorLast" => "Bo",
- "pet" => "cat"
- }
- which would call itself again since there still exists %{} values, the next run through would yield:
- {
- "title" => "The Dream of Jim Bo's cat",
- "author" => "Jim Bo",
- "authorFirst" => "Jim",
- "authorLast" => "Bo",
- "pet" => "cat"
- }
Advertisement
Add Comment
Please, Sign In to add comment