lib/yao/resources/action.rb in yao-0.13.4 vs lib/yao/resources/action.rb in yao-0.14.0

- old
+ new

@@ -1,15 +1,22 @@ module Yao::Resources module Action + + # @param id [String] + # @param query [Hash] + # @return [Hash] def action(id, query) res = POST(action_path(id)) do |req| req.body = query.to_json req.headers['Content-Type'] = 'application/json' end res.body end private + + # @param id [String] + # @return [String] def action_path(id) [resources_name, id, "action"].join("/") end end end