Class: SimplePublisher::StarlingConnection

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_publisher/starling_connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ StarlingConnection

Returns a new instance of StarlingConnection.



8
9
10
# File 'lib/simple_publisher/starling_connection.rb', line 8

def initialize(attributes = {})
  @starling_url = "#{attributes[:host]}:#{attributes[:port]}"
end

Instance Attribute Details

#starling_urlObject (readonly)

Returns the value of attribute starling_url.



6
7
8
# File 'lib/simple_publisher/starling_connection.rb', line 6

def starling_url
  @starling_url
end

Instance Method Details

#write(options) ⇒ Object



12
13
14
# File 'lib/simple_publisher/starling_connection.rb', line 12

def write(options)
  starling.set(options[:to].name, options[:message].body)
end