Class: Centrifuge::Builder
- Inherits:
-
Object
- Object
- Centrifuge::Builder
- Defined in:
- lib/centrifuge/builder.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#data ⇒ Object
Returns the value of attribute data.
-
#method ⇒ Object
Returns the value of attribute method.
Instance Method Summary collapse
-
#initialize(method, data, client) ⇒ Builder
constructor
A new instance of Builder.
- #process ⇒ Object
Constructor Details
#initialize(method, data, client) ⇒ Builder
Returns a new instance of Builder.
7 8 9 |
# File 'lib/centrifuge/builder.rb', line 7 def initialize(method, data, client) @method, @data, @client = method, data, client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
5 6 7 |
# File 'lib/centrifuge/builder.rb', line 5 def client @client end |
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/centrifuge/builder.rb', line 5 def data @data end |
#method ⇒ Object
Returns the value of attribute method.
5 6 7 |
# File 'lib/centrifuge/builder.rb', line 5 def method @method end |
Instance Method Details
#process ⇒ Object
11 12 13 14 15 |
# 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 |