class Centrifuge::Builder
Attributes
client[RW]
data[RW]
method[RW]
Public Class Methods
new(method, data, client)
click to toggle source
# File lib/centrifuge/builder.rb, line 7 def initialize(method, data, client) @method, @data, @client = method, data, client end
Public Instance Methods
process()
click to toggle source
# File lib/centrifuge/builder.rb, line 11 def process body = { data: json(method, data) } body.merge!(sign: client.sign(body[:data])) Centrifuge::Request.new(client.client, 'POST', client.url, nil, body).send end
Private Instance Methods
json(method, params)
click to toggle source
# File lib/centrifuge/builder.rb, line 19 def json(method, params) MultiJson.dump({ method: method, params: params }) end