Class: Grenache::Link
- Inherits:
-
Object
- Object
- Grenache::Link
- Defined in:
- lib/grenache/link.rb
Overview
Implement Grape connection helpers
Instance Method Summary collapse
-
#initialize(config) ⇒ Link
constructor
Initialize passing configuration.
-
#send(type, payload, opts = {}, &block) ⇒ Object
Send a message to grape.
Constructor Details
#initialize(config) ⇒ Link
Initialize passing configuration
6 7 8 |
# File 'lib/grenache/link.rb', line 6 def initialize(config) @config = config end |
Instance Method Details
#send(type, payload, opts = {}, &block) ⇒ Object
Send a message to grape
11 12 13 14 15 |
# File 'lib/grenache/link.rb', line 11 def send(type, payload, opts = {}, &block) res = http_send type, Oj.dump({"rid" => uuid, "data" => payload}) block.call(res) if block res end |