structr:使用正则表达式构建纯文本

时间:2021-06-24 09:52:29
【文件属性】:
文件名称:structr:使用正则表达式构建纯文本
文件大小:9KB
文件格式:ZIP
更新时间:2021-06-24 09:52:29
Ruby 结构 将纯文本绑定到 Ruby 类。 灵感来自 ROXML 用法 require 'structr' Load = Struct . new ( :one , :five , :fifteen ) ProcessItem = Struct . new ( :pid , :user ) class Top include Structr converter :load do | one , five , fifteen | Load . new ( one . to_f , five . to_f , fifteen . to_f ) end converter :process do | pid , user | ProcessItem . new ( pid . to_i , user ) end field :uptime , /top
【文件预览】:
structr-master
----.gitignore(52B)
----.travis.yml(199B)
----.rubocop.yml(189B)
----examples()
--------top.rb(1KB)
--------invoice.rb(750B)
----spec()
--------field_descriptor_spec.rb(1KB)
--------spec_helper.rb(46B)
--------structr_spec.rb(5KB)
----README.md(2KB)
----.rubocop_todo.yml(2KB)
----lib()
--------structr.rb(2KB)
--------structr()
----rakelib()
--------rubocop.rake(363B)
----Gemfile(76B)
----Rakefile(678B)
----structr.gemspec(748B)

网友评论