-
-
Save vasilakisfil/48decd9161757cec6e4b to your computer and use it in GitHub Desktop.
proc in block params
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
class RoutePathStatisticsEntity < Grape::Entity | |
present_collection true | |
expose :statistic do |route_path, options| | |
#what I want is in route_path[:items] due to: present_collection true | |
route_path[:items].foobar | |
end | |
end | |
#ideally | |
class RoutePathStatisticsEntity < Grape::Entity | |
present_collection true | |
expose :statistic do |{something that returns route_path[:items], options| | |
#what I want is in route_path directly | |
route_path.foobar | |
end | |
end | |
#or | |
class RoutePathStatisticsEntity < Grape::Entity | |
present_collection true | |
expose :statistic do {something that returns route_path[:items], options} | |
#what I want is in route_path directly | |
route_path.foobar | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment