Class: HelloAPI
Overview
Instance Attribute Summary
#req, #resp, #sess
Instance Method Summary
collapse
#handle_action, #initialize
Constructor Details
This class inherits a constructor from K8::BaseAction
Instance Method Details
#do_create ⇒ Object
21
22
23
24
|
# File 'lib/keight/skeleton/app/api/hello.rb', line 21
def do_create()
form = @req.params_form {"action"=>"create", "form"=>form}
end
|
#do_delete(id) ⇒ Object
35
36
37
|
# File 'lib/keight/skeleton/app/api/hello.rb', line 35
def do_delete(id)
{"action"=>"delete", "id"=>id}
end
|
#do_index ⇒ Object
or if you want support ‘/hello.json’ and ‘/hello/123.json’: mapping ‘ext’ , :GET=>:do_index, :POST=>:do_create mapping ‘/idext’ , :GET=>:do_show, :PUT=>:do_update, :DELETE=>:do_delete
16
17
18
19
|
# File 'lib/keight/skeleton/app/api/hello.rb', line 16
def do_index()
query = @req.params_query {"action"=>"index", "query"=>query}
end
|
#do_show(id) ⇒ Object
26
27
28
|
# File 'lib/keight/skeleton/app/api/hello.rb', line 26
def do_show(id)
{"action"=>"show", "id"=>id}
end
|
#do_update(id) ⇒ Object
30
31
32
33
|
# File 'lib/keight/skeleton/app/api/hello.rb', line 30
def do_update(id)
form = @req.params_form {"action"=>"update", "id"=>id, "form"=>form}
end
|