Class: RubyHome::HTTP::SocketNotifier
- Inherits:
-
Object
- Object
- RubyHome::HTTP::SocketNotifier
- Defined in:
- lib/ruby_home/http/services/socket_notifier.rb
Instance Attribute Summary collapse
-
#characteristic ⇒ Object
readonly
Returns the value of attribute characteristic.
-
#socket ⇒ Object
readonly
Returns the value of attribute socket.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(socket, characteristic) ⇒ SocketNotifier
constructor
A new instance of SocketNotifier.
- #updated(_) ⇒ Object
Constructor Details
#initialize(socket, characteristic) ⇒ SocketNotifier
Returns a new instance of SocketNotifier.
4 5 6 7 |
# File 'lib/ruby_home/http/services/socket_notifier.rb', line 4 def initialize(socket, characteristic) @socket = socket @characteristic = characteristic end |
Instance Attribute Details
#characteristic ⇒ Object (readonly)
Returns the value of attribute characteristic.
23 24 25 |
# File 'lib/ruby_home/http/services/socket_notifier.rb', line 23 def characteristic @characteristic end |
#socket ⇒ Object (readonly)
Returns the value of attribute socket.
23 24 25 |
# File 'lib/ruby_home/http/services/socket_notifier.rb', line 23 def socket @socket end |
Instance Method Details
#==(other) ⇒ Object
17 18 19 20 21 |
# File 'lib/ruby_home/http/services/socket_notifier.rb', line 17 def ==(other) self.class == other.class && self.socket == other.socket && self.characteristic == other.characteristic end |
#updated(_) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/ruby_home/http/services/socket_notifier.rb', line 9 def updated(_) if socket_still_active? send_ev_response else characteristic.unsubscribe(self) end end |