Class: MSG_Chumby::BoundaryHandler

Inherits:
Mongrel::HttpHandler
  • Object
show all
Defined in:
lib/msg-chumby-daemon/http-xml-server.rb

Instance Method Summary collapse

Constructor Details

#initialize(boundaries) ⇒ BoundaryHandler

Returns a new instance of BoundaryHandler.



156
157
158
159
160
161
162
# File 'lib/msg-chumby-daemon/http-xml-server.rb', line 156

def initialize(boundaries)
  @boundaries = 
   {'low' => [boundaries[:low]],
    'mid' => [boundaries[:mid]],
    'high' => [boundaries[:high]]}
  @cached_document=XmlSimple.xml_out(@boundaries ,{'RootName' => "consumption"})
end

Instance Method Details

#process(request, response) ⇒ Object



163
164
165
166
167
168
# File 'lib/msg-chumby-daemon/http-xml-server.rb', line 163

def process(request, response)
  response.start(200) do |head,out|
    head["Content-Type"] = "text/xml"
    out.write(@cached_document);
  end
end