Module: Lipa::Web::Response

Included in:
Application
Defined in:
lib/lipa/web/response.rb,
lib/lipa/web/response/xml.rb,
lib/lipa/web/response/html.rb,
lib/lipa/web/response/json.rb

Defined Under Namespace

Modules: HTML, JSON, XML

Instance Method Summary collapse

Instance Method Details

#respond(node, format) ⇒ Object

Rendering node data in format

Parameters:

  • node (Lipa::Node)

    node for rendering

  • format

    of rendering



37
38
39
40
41
42
43
44
45
46
# File 'lib/lipa/web/response.rb', line 37

def respond(node, format)
  case format.to_s 
  when "json"
    JSON::response(node)
  when "xml"
    XML::response(node)
  else
    HTML::response(node)
  end
end