Sha256: 47565f03473917e449cd036ed5799093cb023cc8436a70b22bedcad78f036d28

Contents?: true

Size: 369 Bytes

Versions: 22

Compression:

Stored size: 369 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
      return_resource(resource_from_json(res.body))
    end

    private
    def action_path(id)
      [resources_name, id, "action"].join("/")
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
yao-0.4.0 lib/yao/resources/action.rb
yao-0.3.8 lib/yao/resources/action.rb
yao-0.3.7 lib/yao/resources/action.rb
yao-0.3.6 lib/yao/resources/action.rb
yao-0.3.5 lib/yao/resources/action.rb
yao-0.3.4 lib/yao/resources/action.rb
yao-0.3.3 lib/yao/resources/action.rb
yao-0.3.2 lib/yao/resources/action.rb
yao-0.3.1 lib/yao/resources/action.rb
yao-0.3.0 lib/yao/resources/action.rb
yao-0.2.13 lib/yao/resources/action.rb
yao-0.2.12 lib/yao/resources/action.rb
yao-0.2.11 lib/yao/resources/action.rb
yao-0.2.10 lib/yao/resources/action.rb
yao-0.2.9 lib/yao/resources/action.rb
yao-0.2.8 lib/yao/resources/action.rb
yao-0.2.7 lib/yao/resources/action.rb
yao-0.2.6 lib/yao/resources/action.rb
yao-0.2.5 lib/yao/resources/action.rb
yao-0.2.4 lib/yao/resources/action.rb