[Snipet] Ruby Hash dot syntax

Discussion in 'RGSS3 Scripts (RMVX Ace)' started by dsiver144, Jun 6, 2018.

  1. dsiver144

    dsiver144 Peaceful Days Dev Veteran

    Messages:
    255
    Likes Received:
    776
    Location:
    Vietnam
    First Language:
    Vietnamese
    Primarily Uses:
    RMVXA
    RUBY HASH DOT NOTATION
    While coding in Js, I just realized that it would be awesome if Ruby hash can use dot syntax like Js object. So I googled for the answer. And I found a way to do it with simple line of codes. It would be useful for some coders, I guess.
    You can grab it here: Pastebin
     
    #1
    Kvothe and TheoAllen like this.
  2. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,450
    Likes Received:
    5,041
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    This kinda makes the script harder to read since we don't know if the object is hash or not, but I like the idea
     
    #2
    dsiver144 likes this.
  3. dsiver144

    dsiver144 Peaceful Days Dev Veteran

    Messages:
    255
    Likes Received:
    776
    Location:
    Vietnam
    First Language:
    Vietnamese
    Primarily Uses:
    RMVXA
    Yea, we may use old way in a big script. :D
     
    #3

Share This Page