Class: CatsocketClient::Publisher

Inherits:
Struct
  • Object
show all
Defined in:
lib/catsocket_client/publisher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key

Returns:

  • (Object)

    the current value of api_key



4
5
6
# File 'lib/catsocket_client/publisher.rb', line 4

def api_key
  @api_key
end

#urlObject

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



4
5
6
# File 'lib/catsocket_client/publisher.rb', line 4

def url
  @url
end

Instance Method Details

#publish(channel, data) ⇒ Object



6
7
8
# File 'lib/catsocket_client/publisher.rb', line 6

def publish(channel, data)
  RestClient.post(url, guid: 0, api_key: api_key, channel: channel, data: data )
end