Class: WideReceiver::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/wide_receiver/config.rb

Defined Under Namespace

Classes: NullUri

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#message_formatObject



19
20
21
# File 'lib/wide_receiver/config.rb', line 19

def message_format
  @message_format || :raw
end

#queue_urlObject

Returns the value of attribute queue_url.



8
9
10
# File 'lib/wide_receiver/config.rb', line 8

def queue_url
  @queue_url
end

Class Method Details

.instanceObject



11
12
13
# File 'lib/wide_receiver/config.rb', line 11

def self.instance
  @instance ||= new
end

.reset!Object



15
16
17
# File 'lib/wide_receiver/config.rb', line 15

def self.reset!
  @instance = nil
end

Instance Method Details

#adapterObject



23
24
25
# File 'lib/wide_receiver/config.rb', line 23

def adapter
  WideReceiver::Adapters.const_get(queue_uri.scheme.capitalize + 'Adapter')
end

#queue_uriObject



27
28
29
# File 'lib/wide_receiver/config.rb', line 27

def queue_uri
  @uri ||= URI.parse(queue_url) rescue NullUri.new('null', nil, nil, nil)
end