Class: RubyHome::HAP::EVResponse
- Inherits:
-
Object
- Object
- RubyHome::HAP::EVResponse
- Defined in:
- lib/ruby_home/hap/ev_response.rb
Instance Method Summary collapse
-
#initialize(session, body) ⇒ EVResponse
constructor
A new instance of EVResponse.
- #send_response ⇒ Object
Constructor Details
#initialize(session, body) ⇒ EVResponse
Returns a new instance of EVResponse.
4 5 6 7 8 |
# File 'lib/ruby_home/hap/ev_response.rb', line 4 def initialize(session, body) @session = session @socket = session.socket @body = body end |
Instance Method Details
#send_response ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/ruby_home/hap/ev_response.rb', line 10 def send_response response = '' send_header(response) send_body(response) encrypter = session.encrypter encrypted_response = encrypter.encrypt(response).join session.accessory_to_controller_count = encrypter.count socket << encrypted_response end |