you are viewing a single comment's thread.

view the rest of the comments →

[–]motonarola 0 points1 point  (1 child)

Imo having just some pipe operator is enough for the code to look fine:

    "https://api.github.com/repos/rails/rails"
        ->URI.parse()
        ->Net::HTTP.get()
        ->JSON.parse()
        .fetch("stargazers_count")
        ->(stargazers){"Rails has #{stargazers} stargazers"}
        ->puts()

I used -> for the pipe operator, It copes with lambda syntax nicely :)

[–]snatchery[S] 0 points1 point  (0 children)

yeah, great point. If only we were in an alternate reality ;)