内容简介:Hanami —— Ruby 的 Web 框架
Hanami 是一个全栈的 Ruby 的 Web 框架。是一个非常精简、用于单一用途的库。
Hanami 包含如下组件:
-
Hanami::Model - 实体的持久化、仓库和数据映射
-
Hanami::View - 视图和模板的呈现
-
Hanami::Controller - 全功能、快速可测试的控制层
-
Hanami::Validations - Ruby 数据的验证
-
Hanami::Router - Rack 兼容的 HTTP 路由
-
Hanami::Helpers - 视图助手
-
Hanami::Mailer - 邮件 工具 包
-
Hanami::Assets - 附件管理
-
Hanami::Utils - Ruby 核心扩展和工具包
目录结构:
% tree apps/web
apps/web
├── application.rb
├── assets
│ ├── favicon.ico
│ ├── images
│ ├── javascripts
│ └── stylesheets
├── config
│ └── routes.rb
├── controllers
├── templates
│ └── application.html.erb
└── views
└── application_layout.rb
8 directories, 5 files
示例代码:
# apps/web/controllers/dashboard/index.rbmodule Web::Controllers::Dashboard
class Index
include Web::Action
def initialize(greeting: Greeting.new)
@greeting = greeting
end
def call(params)
self.body = @greeting.message
end
endend
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- 基于Google MVVM框架的baseMVVM框架
- Spring 框架是怎么出生的(二):重构提炼出框架
- Spring 框架是怎么出生的(二):重构提炼出框架
- Genesis框架从入门到精通(7): 框架的过滤器
- 如何打造自己的POC框架-Pocsuite3-框架篇
- 如何打造自己的PoC框架-Pocsuite3-框架篇
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
The Art of Computer Programming, Volumes 1-3 Boxed Set
Donald E. Knuth / Addison-Wesley Professional / 1998-10-15 / USD 199.99
This multivolume work is widely recognized as the definitive description of classical computer science. The first three volumes have for decades been an invaluable resource in programming theory and p......一起来看看 《The Art of Computer Programming, Volumes 1-3 Boxed Set》 这本书的介绍吧!