Class: Gors::Controller

Inherits:
Object
  • Object
show all
Defined in:
lib/gors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ Controller

Returns a new instance of Controller.



179
180
181
182
183
184
# File 'lib/gors.rb', line 179

def initialize(context)
  @info = context
   if(self.respond_to? "before")
    self.before
   end
end

Instance Attribute Details

#infoObject

Returns the value of attribute info.



177
178
179
# File 'lib/gors.rb', line 177

def info
  @info
end

Instance Method Details

#erb(template) ⇒ Object



186
187
188
189
190
# File 'lib/gors.rb', line 186

def erb template
  renderer = Tilt::ERBTemplate.new("views/layout.erb")
  output = renderer.render(self){ Tilt::ERBTemplate.new("views/"+template.to_s+".erb").render(self) }
  return output
end

#paramsObject



192
193
194
# File 'lib/gors.rb', line 192

def params
  @info.request.params
end