Skip to content

Instantly share code, notes, and snippets.

@vasilakisfil
Last active September 26, 2015 14:13
Show Gist options
  • Save vasilakisfil/48decd9161757cec6e4b to your computer and use it in GitHub Desktop.
Save vasilakisfil/48decd9161757cec6e4b to your computer and use it in GitHub Desktop.
proc in block params
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