Module: Waves::Controllers::Mixin

Includes:
ResponseMixin
Included in:
Base
Defined in:
lib/waves/layers/mvc/controllers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ResponseMixin

#app, #attributes, #captured, #controller, #http_cache, #log, #main, #model, #model_name, #modified?, #not_found, #not_modified, #params, #paths, #query, #redirect, #resource, #response, #traits, #view

Instance Attribute Details

#requestObject (readonly)

Returns the value of attribute request.



7
8
9
# File 'lib/waves/layers/mvc/controllers.rb', line 7

def request
  @request
end

Instance Method Details

#create(attributes) ⇒ Object



19
20
21
# File 'lib/waves/layers/mvc/controllers.rb', line 19

def create( attributes )
  model.create( attributes )
end

#delete(name) ⇒ Object



27
28
29
# File 'lib/waves/layers/mvc/controllers.rb', line 27

def delete( name )
  model.delete( name )
end

#find(name) ⇒ Object



15
16
17
# File 'lib/waves/layers/mvc/controllers.rb', line 15

def find( name )
  model.find( name )
end

#initialize(request) ⇒ Object



11
12
13
# File 'lib/waves/layers/mvc/controllers.rb', line 11

def initialize( request )
  @request = request
end

#listObject



31
32
33
# File 'lib/waves/layers/mvc/controllers.rb', line 31

def list
  model.all
end

#update(name, attributes) ⇒ Object



23
24
25
# File 'lib/waves/layers/mvc/controllers.rb', line 23

def update( name, attributes )
  find( name ).attributes = attributes
end