Class: RubyHome::HTTP::ApplicationController
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- RubyHome::HTTP::ApplicationController
show all
- Defined in:
- lib/ruby_home/http/controllers/application_controller.rb
Instance Method Summary
collapse
Instance Method Details
#accessory_info ⇒ Object
20
21
22
|
# File 'lib/ruby_home/http/controllers/application_controller.rb', line 20
def accessory_info
AccessoryInfo
end
|
#cache ⇒ Object
32
33
34
|
# File 'lib/ruby_home/http/controllers/application_controller.rb', line 32
def cache
GlobalCache.instance[request_id] ||= Cache.new
end
|
#identifier_cache ⇒ Object
24
25
26
|
# File 'lib/ruby_home/http/controllers/application_controller.rb', line 24
def identifier_cache
IdentifierCache
end
|
#json_body ⇒ Object
13
14
15
16
17
18
|
# File 'lib/ruby_home/http/controllers/application_controller.rb', line 13
def json_body
@_json_body ||= begin
request.body.rewind
JSON.parse(request.body.read)
end
end
|
#request_id ⇒ Object
28
29
30
|
# File 'lib/ruby_home/http/controllers/application_controller.rb', line 28
def request_id
Application.request_id
end
|
#unpack_request ⇒ Object
6
7
8
9
10
11
|
# File 'lib/ruby_home/http/controllers/application_controller.rb', line 6
def unpack_request
@_unpack_request ||= begin
request.body.rewind
TLV.unpack(request.body.read)
end
end
|