Class: FakeSQS::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/fake_sqs/server.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Server

Returns a new instance of Server.



6
7
8
9
# File 'lib/fake_sqs/server.rb', line 6

def initialize(options)
  @host = options.fetch(:host)
  @port = options.fetch(:port)
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



4
5
6
# File 'lib/fake_sqs/server.rb', line 4

def host
  @host
end

#portObject (readonly)

Returns the value of attribute port.



4
5
6
# File 'lib/fake_sqs/server.rb', line 4

def port
  @port
end

Instance Method Details

#url_for(queue_id) ⇒ Object



11
12
13
# File 'lib/fake_sqs/server.rb', line 11

def url_for(queue_id)
  "http://#{host}:#{port}/#{queue_id}"
end