Class: Grenache::Link

Inherits:
Object
  • Object
show all
Defined in:
lib/grenache/link.rb

Overview

Implement Grape connection helpers

Instance Method Summary collapse

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