Class: Amber::View::Json

Inherits:
Amber::View show all
Defined in:
lib/amber/view/json.rb

Instance Attribute Summary

Attributes inherited from Amber::View

#code, #content, #header

Instance Method Summary collapse

Constructor Details

#initialize(code = 404, header = {}, data = nil) ⇒ Json

Returns a new instance of Json.



2
3
4
5
6
7
8
# File 'lib/amber/view/json.rb', line 2

def initialize(code = 404, header = {}, data = nil)
  super code, header, Amber::Switch::Content::Json.new

  if data
    self.content.data = data
  end
end