Class: LIFX::Transport Private

Inherits:
Object
  • Object
show all
Defined in:
lib/lifx/transport.rb,
lib/lifx/transport/tcp.rb,
lib/lifx/transport/udp.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, port, ignore_unpackable_messages: true) ⇒ Transport

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Transport.



11
12
13
14
15
# File 'lib/lifx/transport.rb', line 11

def initialize(host, port, ignore_unpackable_messages: true)
  @host = host
  @port = port
  @ignore_unpackable_messages = ignore_unpackable_messages
end

Instance Attribute Details

#hostObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
# File 'lib/lifx/transport.rb', line 9

def host
  @host
end

#portObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
# File 'lib/lifx/transport.rb', line 9

def port
  @port
end

Instance Method Details

#closeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/lifx/transport.rb', line 25

def close
  raise NotImplementedError
end

#listenObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/lifx/transport.rb', line 17

def listen
  raise NotImplementedError
end

#observer_callback_definitionObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



34
35
36
# File 'lib/lifx/transport.rb', line 34

def observer_callback_definition
  -> (message:, ip: nil, transport: nil) {}
end

#to_sObject Also known as: inspect

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



29
30
31
# File 'lib/lifx/transport.rb', line 29

def to_s
  %Q{#<#{self.class.name} #{host}:#{port}>}
end

#write(message) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/lifx/transport.rb', line 21

def write(message)
  raise NotImplementedError
end