文件名称:transitions:从ActiveModel中提取状态机
文件大小:37KB
文件格式:ZIP
更新时间:2024-06-03 21:32:54
Ruby
概述 概要 transitions是Ruby状态机的实现。 安装 滑轨 这进入您的Gemfile: gem "transitions" , :require => [ "transitions" , "active_model/transitions" ] …并将其纳入您的ORM模型: include ActiveModel :: Transitions 单机版 gem install transitions …并将其纳入您的班级: include Transitions 使用过渡 class Product include ActiveModel :: Transitions state_machine do state :available # first one is initial state state :out_of_stock , :exit
【文件预览】:
transitions-master
----gemfiles()
--------rails_4_0.gemfile(227B)
--------rails_3_1.gemfile(215B)
--------rails_3_2.gemfile(215B)
--------rails_3_0.gemfile(216B)
----LICENSE.txt(1KB)
----.ruby-version(6B)
----lib()
--------transitions.rb(2KB)
--------transitions()
--------active_record()
--------active_model()
----Gemfile(177B)
----.todo.reek(3KB)
----.codeclimate.yml(122B)
----transitions.gemspec(1KB)
----Rakefile(426B)
----.travis.yml(436B)
----test()
--------state()
--------event()
--------helper.rb(391B)
--------machine()
--------active_record()
--------state_transition()
----README.md(14KB)
----.rubocop.yml(646B)
----Appraisals(652B)
----.gitignore(60B)
----bin()
--------console(92B)
----CHANGELOG.md(5KB)