power-types:Platanus 团队使用的 Rails 模式强制类型

时间:2021-05-29 20:16:47
【文件属性】:
文件名称:power-types:Platanus 团队使用的 Rails 模式强制类型
文件大小:31KB
文件格式:ZIP
更新时间:2021-05-29 20:16:47
Ruby 电源类型 Platanus 团队使用的 Rails 模式强制类型。 介绍 在 Rails 项目中,Platanus 鼓励使用模型和控制器之外的类来保存应用程序的逻辑。 提议的这些强大的类型是服务、命令、观察者、实用程序和值。 要更深入地了解这些模式的用法,欢迎阅读(西班牙语)中的。 这个 gem 的目标是走得更远,而不仅仅是在 PORO(简单的简单 ruby​​ 类)上应用这种模式。 gem 提供了一种特殊的结构和语法来轻松创建和运行服务、命令等。 它还为每种类型创建目录,并提供生成器。 安装 添加到您的 Gemfile: gem "power-types" bundle install 电源类型 服务 为了生成服务,我们使用: $ rails generate service MyService foo bar 这将创建 MyService 类,继承自基础服务类:
【文件预览】:
power-types-master
----.coveralls.yml(24B)
----.hound.yml(56B)
----LICENSE.txt(1KB)
----.ruby-version(4B)
----lib()
--------generators()
--------power_types()
--------power-types.rb(22B)
--------power_types.rb(474B)
----power-types.gemspec(2KB)
----Gemfile(96B)
----Guardfile(2KB)
----spec()
--------lib()
--------spec_helper.rb(793B)
--------power_types_spec.rb(132B)
----Rakefile(117B)
----.travis.yml(895B)
----README.md(9KB)
----.rubocop.yml(17KB)
----.rspec(31B)
----CODE_OF_CONDUCT.md(2KB)
----.gitignore(87B)

网友评论