You're declaring a function and applying it. The function "to_cookbook_dir" is meant to mean, change this to some sort of a CookbookDir object. Expanding it out, I think, is harder to read. I can break it up into multiple assignments to @children, although that seems kinda dirty to me.

````
raw_children = rest.get_rest(_api_path)
unsorted_children = if  # ...
@children = unsorted_children.flatten.sort_by { |c| c.name }
````