GithubHelp home page GithubHelp logo

New Hash type: Rash about hashie HOT 10 CLOSED

hashie avatar hashie commented on July 20, 2024
New Hash type: Rash

from hashie.

Comments (10)

epitron avatar epitron commented on July 20, 2024

Oh, it also lets you use Ranges as keys, so you can map a range of integers to a value.

from hashie.

bartoszkopinski avatar bartoszkopinski commented on July 20, 2024

Hi @epitron,
Thanks for this idea.

I can see some use cases for this, but I'm not sure if they're hash (dict) use cases.
Eg. what would be the reason for storing something in Rash object? I'm thinking about def []=(key, value) and method_missing fallback to hash.

from hashie.

epitron avatar epitron commented on July 20, 2024

Well, if you're trying to match patterns as well as exact keys, it can give you a slight performance improvement than just scanning a list (it periodically resorts the regexps based on how frequently they're accessed).

I originally created it to do URL routing (matching patterns to actions).

from hashie.

bartoszkopinski avatar bartoszkopinski commented on July 20, 2024

OK, that makes sense, definitely something to consider.

I guess we'd appreciate a pull request as right now we'll be focused on fixing existing features and bringing Hashie back to life after one year of inactivity.

from hashie.

epitron avatar epitron commented on July 20, 2024

Okay! The Rash has been merged, specs have been written, and documentation has been added.

from hashie.

dblock avatar dblock commented on July 20, 2024

So... open a pull request? :)

from hashie.

dblock avatar dblock commented on July 20, 2024

Nm,I see it, #138

from hashie.

rmoriz avatar rmoriz commented on July 20, 2024

Naming collides with the rash gem

see also:

https://github.com/tcocca/rash
https://github.com/lostisland/faraday_middleware/blob/master/lib/faraday_middleware/response/rashify.rb

from hashie.

michaelherold avatar michaelherold commented on July 20, 2024

Is there anything left to do for this? Do we want to address the name conflict with the rash gem?

from hashie.

dblock avatar dblock commented on July 20, 2024

This is done, closing. The Rash gem is another implementation, shouldn't be used together with this. Faraday might want to lock to a newer version of Hashie and remove the dependency on Rash, lostisland/faraday_middleware#94.

from hashie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.