Class: Stackify::TransportSelector

Inherits:
Object
  • Object
show all
Defined in:
lib/stackify/transport_selector.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ TransportSelector

Returns a new instance of TransportSelector.



6
7
8
9
10
11
12
13
14
15
# File 'lib/stackify/transport_selector.rb', line 6

def initialize type
  case type
  when Stackify::DEFAULT
    Stackify::Utils.do_only_if_authorized_and_mode_is_on Stackify::MODES[:logging] do
      @transport = Stackify::LogsSender.new
    end
  when Stackify::UNIX_SOCKET
    @transport = Stackify::UnixSocketClient.new
  end
end

Instance Attribute Details

#transportObject (readonly)

Returns the value of attribute transport.



4
5
6
# File 'lib/stackify/transport_selector.rb', line 4

def transport
  @transport
end