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