Sha256: 0af3c78f651d4acbea122609774b557a5678af65a1c25e99ace6bfcad85ebb68

Contents?: true

Size: 332 Bytes

Versions: 5

Compression:

Stored size: 332 Bytes

Contents

module Yao::Resources
  module Action
    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
    def action_path(id)
      [resources_name, id, "action"].join("/")
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
yao-0.13.4 lib/yao/resources/action.rb
yao-0.13.3 lib/yao/resources/action.rb
yao-0.13.2 lib/yao/resources/action.rb
yao-0.13.1 lib/yao/resources/action.rb
yao-0.13.0 lib/yao/resources/action.rb