item_api.rb
来自「基于ruby的进阶编程,大家可以对照教材<<Ruby on Rail」· RB 代码 · 共 12 行
RB
12 行
class Item < ActionWebService::Struct
member :id, :int
member :title, :string
end
class ItemApi < ActionWebService::API::Base api_method :find_all_items,
:returns => [[Item]]
api_method :find_item_by_id,
:expects => [:int],
:returns => [Item]end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?