dry-rb / dry-inflector

Inflector for Ruby
https://dry-rb.org/gems/dry-inflector
MIT License
95 stars 15 forks source link

[flexus port] Issue about inheriting from core classes #2

Closed abinoam closed 7 years ago

abinoam commented 7 years ago

Reek were complaing about RulesCollections directly inheriting from a core class Array at flexus.

We have fixed this in flexus at https://github.com/Ptico/flexus/pull/10/commits/e8c5b29a6d885985779c27da532aed1fa4d552f6 and https://github.com/Ptico/flexus/pull/10/commits/8eed6f17c93b258349fafb71c60dd7e9601bed62

We have applied delegation and added a #to_a method that returns a dup of the internal array (not exposing internal state).

Should we port this to Dry::Inflector? Any other suggestions about the implementation or anything?

jodosha commented 7 years ago

@abinoam We don't inherit from core classes here. Am I missing something?

abinoam commented 7 years ago

I was using an outdated master branch. Sorry!

abinoam commented 7 years ago

Already fixed between the last commits https://github.com/dry-rb/dry-inflector/commit/1fb10d47bbd8357503673bb6d977b32130409d79#diff-4ba972410585018e9d949f15a31feb75R8