dessm

Activity Graph

Page 1 of 1

2018-03-01

[03:42:47] dessm: has joined #ruby
[03:47:00] dessm: changes as well. I'd like to keep the original payload around without modifying it, so I usually marshal dump/load the new hashes before modifying them. This seems absurdly kludgy and leads me to believe that I'm somehow approaching the problem in a wholly un-Rubyesque way. What is the Ruby way to handle this situation?
[03:47:00] dessm: Good evening. I've been wondering about the following: Often times when dealing with external APIs I'll get back some rather large JSON payload which I then parse into a Ruby hash. Usuallly I need specific parts of that hash so I might make a bunch of new hashes like: random_hash = payload[:some_key][:another_key] etc. Now the problem that I run into is that I need to transform that data. But when I modify the new hashes random_hash
[04:12:41] dessm: Remote host closed the connection

2016-07-22

[01:02:35] dessm: has joined #RubyOnRails
[01:05:32] dessm: Hi, I am not sure if it's okay to ask questions here (I apologize if it isn't), but I have what I suspect is a ridiculously easy question that I can't find the answer to despite extensive googling. I am trying to access an epub file from within a script tag in a view. Where do I need to save the file and how do I specify the path? I tried assets and indicating the full path without any...
[01:05:34] dessm: ...success. Any pointers of what might be going on or where I can find further information would be greatly appreciated. Thanks.
[01:18:03] dessm: Quit: ChatZilla 0.9.92 [Firefox 47.0.1/20160630070928]

2016-05-28

[20:15:20] dessm: has joined #ruby
[20:16:32] dessm: Hello :) I am struggling to understand the following: "123".to_i is an integer; "123".to_i.class returns Integer; yet "123".to_i.class.is_a?(Integer) returns false. Why is this? Thank you.
[20:17:13] dessm: (the last turns out to be a module for some reason)
[20:21:46] dessm: ah I see. So how would I then check whether something is of a particular class if this approach doesn't work?
[20:26:05] dessm: oh I see. Duh. Thank you very much, I don't know how I didn't see that :)
[20:32:37] dessm: Yeah I just realized that by trying it out in the irb. Thanks again everyone, sometimes these little issues can cost a lot of time while learning without out providing much benefit so it can be quite helpful to have someone point out these kind of mistakes (even if they should be obvious) :)
[21:07:18] dessm: has left #ruby: ()

2016-05-20

[02:35:02] dessm: has joined #ruby
[02:41:12] dessm: Hi, I have three questions. I am wondering why (Q1) exactly and how (Q2) 'first' works on hashes. 'first' is neither listed in the ruby documentation under hashes nor is it listed in the irb if I type Hash.methods. I suspect that my understanding is still too deficient to google this properly since my search terms don't seem to turn up answers to the question. Q3: I am also wondering if...
[02:41:14] dessm: ...'first' indeed does work on hashes where I might find a COMPLETE list of all the methods that can be applied to hashes.Thank you :)
[02:59:21] dessm: Ah I see, thank you ramfjord_
[03:05:51] dessm: Remote host closed the connection

2016-05-19

[01:01:27] dessm: has joined #ruby
[01:04:14] dessm: Hi, I'm not sure if it's okay to ask questions here, so apologies if I'm breaching etiquette. I'm doing the Ruby koans and was wondering why, if I have an array=[1,2,3], array[3,0] == [], but array[4,0] == nil? Since both start indices are beyond the indeces of the array wouldn't one expect them to return the same value? Thank you.
[01:20:31] dessm: Cool, thank you both very much
[02:25:29] dessm: Quit: ChatZilla 0.9.92 [Firefox 46.0.1/20160503215307]