文件名称:均衡器:自动定义相等,等效和哈希方法
文件大小:15KB
文件格式:ZIP
更新时间:2024-03-12 04:38:59
Ruby
均衡器 定义等同性,等效性和检查方法的模块 例子 class GeoLocation include Equalizer . new ( :latitude , :longitude ) attr_reader :latitude , :longitude def initialize ( latitude , longitude ) @latitude , @longitude = latitude , longitude end end point_a = GeoLocation . new ( 1 , 2 ) point_b = GeoLocation . new ( 1 , 2 ) point_c = GeoLocation . new ( 2 , 2 ) point_a . inspect # => "#<GeoLocation latitude=1
【文件预览】:
equalizer-master
----.gitignore(274B)
----.rspec(74B)
----.ruby-gemset(10B)
----.travis.yml(480B)
----CONTRIBUTING.md(1KB)
----equalizer.gemspec(846B)
----.rubocop.yml(0B)
----.ruby-version(11B)
----LICENSE(1KB)
----spec()
--------unit()
--------support()
--------spec_helper.rb(438B)
----README.md(3KB)
----config()
--------mutant.yml(37B)
--------flay.yml(45B)
--------yardstick.yml(591B)
--------reek.yml(2KB)
--------devtools.yml(27B)
--------rubocop.yml(3KB)
--------flog.yml(38B)
----lib()
--------equalizer()
--------equalizer.rb(3KB)
----.yardstick.yml(19B)
----Gemfile(153B)
----Rakefile(96B)