Class: Pushould::Client
- Inherits:
-
Object
- Object
- Pushould::Client
- Defined in:
- lib/pushould/client.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url) ⇒ Client
constructor
A new instance of Client.
- #trigger(room: _room, event: _event, data: _data) ⇒ Object
Constructor Details
#initialize(url) ⇒ Client
Returns a new instance of Client.
9 10 11 |
# File 'lib/pushould/client.rb', line 9 def initialize(url) @url = url end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
7 8 9 |
# File 'lib/pushould/client.rb', line 7 def url @url end |
Instance Method Details
#trigger(room: _room, event: _event, data: _data) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/pushould/client.rb', line 13 def trigger(room: _room, event: _event, data: _data) data = { room: room, event: event, custom: data }.to_json RestClient::Resource.new(@url) .get(params: { data: data }, content_type: 'application/json', accept: 'application/json') end |