priora:Ruby的对象优先级排序实用程序

时间:2024-04-08 21:49:13
【文件属性】:

文件名称:priora:Ruby的对象优先级排序实用程序

文件大小:13KB

文件格式:ZIP

更新时间:2024-04-08 21:49:13

ruby sorting gem prioritization Ruby

Priora:用于Ruby的对象优先级排序实用程序 Priora提供了一种简单直观的方法来对Ruby中的对象集合进行优先级排序。它是一个有用的实用程序,用于处理某些数据类的多个实例的集合。通常,我们希望按照某种优先级排序逻辑来安排该集合。 Priora提供了一种声明式样式,而不是编写自定义排序块或在类中实现宇宙飞船运算符( <=> ),以便获得即用型集合。 例如,假设我们有一个简单的Post类,其中包含有关作者姓名,收到的喜欢人数以及该帖子是否被赞助的数据: class Post attr_reader :author , :like_count , :is_sponsored def initialize ( author : , like_count : , is_sponsored : ) @author = author @like_count = li


【文件预览】:
priora-master
----.travis.yml(108B)
----bin()
--------console(341B)
--------setup(131B)
----Rakefile(114B)
----.rubocop.yml(129B)
----Gemfile(162B)
----Gemfile.lock(1KB)
----.rspec(53B)
----spec()
--------priora_spec.rb(5KB)
--------spec_helper.rb(362B)
----.gitignore(121B)
----lib()
--------priora()
--------priora.rb(998B)
----.codeclimate.yml(38B)
----README.md(7KB)
----LICENSE.txt(1KB)
----priora.gemspec(1KB)

网友评论