« Back to channel list

#ruby - 16 March 2018

« Back 1 day Forward 1 day »
[00:00:36] ryandv: has joined #ruby
[00:01:43] alfiemax: has joined #ruby
[00:08:05] guacamole: has joined #ruby
[00:08:05] guacamole: has joined #ruby
[00:11:58] tAn: has joined #ruby
[00:12:41] weaksauce: arand this is a touch more idiomatic and testable ruby... though some would do it differently https://gist.github.com/fiveNinePlusR/67c1a9de69bd3a3f80986b07581affe5
[00:12:50] weaksauce: take from it what you will if anything
[00:17:35] karapetyan: has joined #ruby
[00:18:25] alfiemax: has joined #ruby
[00:20:32] ResidentBiscuit: has joined #ruby
[00:21:27] arand: weaksauce: That looks really nice indeed.
[00:24:10] chouhoulis: has joined #ruby
[00:24:52] lemur: has joined #ruby
[00:27:43] allcentury: has joined #ruby
[00:28:58] negatifze: has joined #ruby
[00:33:01] phaul: has joined #ruby
[00:34:43] dviola: has joined #ruby
[00:38:04] gnufied: has joined #ruby
[00:42:44] arand: weaksauce: I would be inclined to name them something which reflect their mutating nature (i.e. with a '!'), is that usually done with methods like these?
[00:43:10] eblip: has joined #ruby
[00:43:22] def_jam: has joined #ruby
[00:43:37] weaksauce: yeah, that's correct arand
[00:51:38] Dimik: has joined #ruby
[00:51:45] tAn: has joined #ruby
[00:52:45] duckpuppy: has joined #ruby
[00:52:52] alfiemax: has joined #ruby
[00:55:09] Jameser: has joined #ruby
[00:58:08] Jameser: has joined #ruby
[00:58:52] bmurt: has joined #ruby
[01:00:24] epochwolf: has joined #ruby
[01:01:25] jxv: has joined #ruby
[01:01:25] mostlybadfly: has joined #ruby
[01:05:54] alfiemax: has joined #ruby
[01:09:24] dinfuehr: has joined #ruby
[01:09:36] DenSchub: has joined #ruby
[01:14:14] ledestin: has joined #ruby
[01:14:23] cthulchu_: has joined #ruby
[01:17:15] nowhere_man: has joined #ruby
[01:19:08] karapetyan: has joined #ruby
[01:22:18] Yzguy: has joined #ruby
[01:27:10] Psybur_: has joined #ruby
[01:28:18] tAn: has joined #ruby
[01:32:21] Psybur: has joined #ruby
[01:50:11] epochwolf: has joined #ruby
[01:52:41] duckpuppy: has joined #ruby
[01:56:27] cdg: has joined #ruby
[01:57:04] ycyclist: has joined #ruby
[01:57:27] ycyclist: So I am trying to do a case statement on something.class, and it always goes to the else case.
[01:57:30] ycyclist: What's with that?
[02:02:53] alfiemax: has joined #ruby
[02:03:11] alfiemax: has joined #ruby
[02:03:33] dinfuehr_: has joined #ruby
[02:05:25] tolerablyjake: has joined #ruby
[02:07:58] tAn: has joined #ruby
[02:10:32] mrush: has joined #ruby
[02:19:13] Frenchiie: has joined #ruby
[02:19:36] ghormoon: has joined #ruby
[02:19:43] tolerablyjake: has joined #ruby
[02:20:23] Radar: ycyclist: code plz
[02:22:17] ycyclist: Sorry. I went around it by using if statements. I was in a hurry. Let me see if I can get it back.. Sorry man.
[02:25:09] nachoman: has joined #ruby
[02:25:37] ghormoon: has joined #ruby
[02:26:27] imode: has joined #ruby
[02:27:25] ycyclist: https://gist.github.com/
[02:29:15] ycyclist: https://gist.github.com/xenocampanoli/83eff64cf27c1df76a75d7207236616c
[02:29:20] ycyclist: Okay, there it is.
[02:29:51] ycyclist: I'll keep that around for tomorrow in case you already went away. I need to go in a minute anyway.
[02:30:29] ghormoon: has joined #ruby
[02:33:01] darkhanb: has joined #ruby
[02:33:58] jenrzzz: has joined #ruby
[02:33:58] jenrzzz: has joined #ruby
[02:34:53] universa1: has joined #ruby
[02:35:16] mrush_: has joined #ruby
[02:35:27] tamouse__: has joined #ruby
[02:44:07] gizmore|2: has joined #ruby
[02:50:15] tAn: has joined #ruby
[02:54:01] duckpuppy: has joined #ruby
[02:54:03] alfiemax: has joined #ruby
[02:55:07] ryandv: has joined #ruby
[02:56:45] kn-928: has joined #ruby
[03:03:51] baweaver: ycyclist: what does class return?
[03:04:05] baweaver: >> 'string'.class
[03:04:06] ruby[bot]: baweaver: # => String (https://eval.in/972900)
[03:04:32] baweaver: and what does case use for evaluation?
[03:04:33] baweaver: >> String === String
[03:04:34] ruby[bot]: baweaver: # => false (https://eval.in/972901)
[03:04:40] baweaver: >> String == String
[03:04:43] ruby[bot]: baweaver: # => true (https://eval.in/972902)
[03:05:11] baweaver: Now what's === aliased to for String?
[03:05:36] baweaver: >> ['test'.is_a?(String), String === 'test']
[03:05:37] ruby[bot]: baweaver: # => [true, true] (https://eval.in/972903)
[03:06:32] baweaver: Therefor...
[03:06:33] baweaver: >> String.is_a?(String)
[03:06:35] ruby[bot]: baweaver: # => false (https://eval.in/972904)
[03:06:43] baweaver: and therein is your problem
[03:07:01] baweaver: >> case 'string'; when String then 1 else 0 end
[03:07:02] ruby[bot]: baweaver: # => 1 (https://eval.in/972905)
[03:07:11] baweaver: >> case 'string'.class; when String then 1 else 0 end
[03:07:12] ruby[bot]: baweaver: # => 0 (https://eval.in/972906)
[03:07:53] karapetyan: has joined #ruby
[03:11:55] milardovich: has joined #ruby
[03:12:01] ycyclist: Yes, but how would you do it then?
[03:12:33] baweaver: Notice the first one when it works?
[03:12:41] baweaver: it doesn't have `class` on it.
[03:12:58] baweaver: Give some of this a read - https://medium.com/rubyinside/triple-equals-black-magic-d934936a6379
[03:15:59] ycyclist: Yes, so I just co case "#{thing.class}" and that works.
[03:17:25] baweaver: then it's always a String
[03:18:29] ycyclist: Yes, well I can use when "string". I am sorry. I already knew I could fix it without a case. Am I still being too dense?
[03:19:13] baweaver: you're trying to match against the class of your argument
[03:19:27] baweaver: by wrapping it in a quotes what's it always going to be?
[03:19:54] ycyclist: I mainly want it readable and case makes it look more readable.
[03:20:19] ycyclist: If I can do it with a case, I will, but if you think I can use case thingy.class somehow properly, I'll try it.
[03:20:34] baweaver: case "#{thing.class}"
[03:20:35] baweaver: What class will case _always_ get now?
[03:20:57] baweaver: you want: case thing
[03:21:11] ycyclist: The cases that work (and I just reran my tests on it, so I know they do) are Array MyThingy etc.
[03:21:13] baweaver: because if you do it that other way it's _always_ a string
[03:21:27] ycyclist: But "Array", "MyThingy" in quotes of course.
[03:21:39] ycyclist: If I could do it without quotes, that would be greate.
[03:21:49] baweaver: Take off the quotes and use: case thing
[03:21:59] baweaver: read that triple equals article above
[03:22:02] ycyclist: but I think with quotes in a case is more helpfully readable than the if statements.
[03:22:33] baweaver: you don't need them
[03:24:05] baweaver: https://repl.it/repls/UpsetNoisyDebugmonitor
[03:24:22] ycyclist: Ok. I really did look at that twice. Trying again.
[03:24:34] baweaver: Anyways, I need to go grab food. Be back later.
[03:25:02] jenrzzz: has joined #ruby
[03:27:17] cdg: has joined #ruby
[03:27:36] memo1: has joined #ruby
[03:27:39] ycyclist: Ok. I get it now. However, magic is not very auditable. I think making a string out of it, or using if statements is clearer. I really do appreciate your energies, however.
[03:28:06] tAn: has joined #ruby
[03:28:10] ycyclist: I know that overloading can be handy, but it can also be a time-sink for research into vernacular when people don't want to spend such time.
[03:28:44] ycyclist: Please accept my complements, however, for your knowledge. That is good to know, and I may use it some day. Not this time, though.
[03:28:54] ycyclist: Compliments.
[03:30:09] Jameser: has joined #ruby
[03:36:07] milardovich: has joined #ruby
[03:38:59] dnewkerk: has joined #ruby
[03:39:28] GinoMan: has joined #ruby
[03:40:21] guacamole: has joined #ruby
[03:40:21] guacamole: has joined #ruby
[03:43:28] roshanavand: has joined #ruby
[03:44:46] ramfjord: has joined #ruby
[03:45:24] ryandv: has joined #ruby
[03:47:23] Ryzokuken: has joined #ruby
[03:49:47] ryandevilla: has joined #ruby
[03:53:38] willmichael: has joined #ruby
[03:53:53] duckpuppy: has joined #ruby
[03:56:49] jenrzzz: has joined #ruby
[04:04:41] Gnut_: has joined #ruby
[04:06:23] tAn: has joined #ruby
[04:13:03] DEac-: has joined #ruby
[04:14:33] jackjackdripper: has joined #ruby
[04:18:31] alfiemax: has joined #ruby
[04:19:27] orbyt_: has joined #ruby
[04:25:14] trautwein: has joined #ruby
[04:29:06] jenrzzz: has joined #ruby
[04:29:06] jenrzzz: has joined #ruby
[04:42:45] tAn: has joined #ruby
[04:45:46] jenrzzz: has joined #ruby
[04:51:20] guacamole: has joined #ruby
[04:51:21] guacamole: has joined #ruby
[04:52:47] Yzguy: has joined #ruby
[04:53:32] gix: has joined #ruby
[04:57:38] duckpuppy: has joined #ruby
[05:03:12] eckhardt_: has joined #ruby
[05:03:49] jenrzzz: has joined #ruby
[05:05:54] unreal_: has joined #ruby
[05:10:31] jenrzzz: has joined #ruby
[05:10:32] jenrzzz: has joined #ruby
[05:25:53] ramfjord: has joined #ruby
[05:26:09] sauvin_: has joined #ruby
[05:26:10] jenrzzz: has joined #ruby
[05:28:25] anisha: has joined #ruby
[05:32:06] tAn: has joined #ruby
[05:32:42] willmichael: has joined #ruby
[05:32:56] ramfjord: has joined #ruby
[05:32:58] nicesignal: has joined #ruby
[05:32:59] jenrzzz: has joined #ruby
[05:35:02] karapetyan: has joined #ruby
[05:36:22] jackjackdripper: has joined #ruby
[05:39:13] jenrzzz: has joined #ruby
[05:39:13] jenrzzz: has joined #ruby
[05:39:14] ramfjord: has joined #ruby
[05:40:16] ltd: has joined #ruby
[05:43:10] ltd: has joined #ruby
[05:44:49] willmichael: has joined #ruby
[05:48:11] nadir: has joined #ruby
[05:48:18] pastorinni: has joined #ruby
[05:49:15] jamesaxl: has joined #ruby
[05:51:24] duckpuppy: has joined #ruby
[06:01:40] tAn: has joined #ruby
[06:03:08] armyriad: has joined #ruby
[06:03:08] cdg: has joined #ruby
[06:03:48] sidx64: has joined #ruby
[06:04:41] jenrzzz: has joined #ruby
[06:05:56] sidx64: has joined #ruby
[06:08:43] armyriad: has joined #ruby
[06:12:03] reber: has joined #ruby
[06:13:16] arquebus: has joined #ruby
[06:17:41] jenrzzz: has joined #ruby
[06:18:40] zipace: has joined #ruby
[06:20:09] Drakevr: has joined #ruby
[06:23:04] willmichael: has joined #ruby
[06:29:41] arquebus: has joined #ruby
[06:30:07] SuperLag: has joined #ruby
[06:32:04] arquebus: has joined #ruby
[06:34:58] Matthew1: has joined #ruby
[06:36:07] ozzloy: has joined #ruby
[06:39:20] karapetyan: has joined #ruby
[06:46:44] jordanm: has joined #ruby
[06:48:09] cschneid: has joined #ruby
[06:49:33] alexis: has joined #ruby
[06:51:17] arekushi: has joined #ruby
[06:53:31] ledestin: has joined #ruby
[06:54:26] duckpuppy: has joined #ruby
[06:57:01] sidx64: has joined #ruby
[06:57:11] alfiemax: has joined #ruby
[07:04:28] conta: has joined #ruby
[07:06:21] ramfjord: has joined #ruby
[07:11:52] sidx64_: has joined #ruby
[07:12:50] banisterfiend: has joined #ruby
[07:13:09] ramfjord: has joined #ruby
[07:13:36] roelof: has joined #ruby
[07:14:57] roelof: I try to solve level 4 of the ruby warrior. But I see this error ` comparising Fixnum with nil failed ` with this code : http://lpaste.net/363679
[07:15:04] roelof: what did I do wrong ?
[07:15:38] andikr: has joined #ruby
[07:15:41] krandi: has joined #ruby
[07:17:59] sidx64: has joined #ruby
[07:19:28] ramfjord: has joined #ruby
[07:26:52] JoshS: has joined #ruby
[07:30:52] sidx64: has joined #ruby
[07:31:47] ruby[bot]: dminuoso: # => undefined method `<' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/972990)
[07:31:53] ruby[bot]: dminuoso: # => comparison of Fixnum with nil failed (ArgumentError) ...check link for more (https://eval.in/972991)
[07:32:18] roelof: am now at level 6 of ruby warrior but im really stuck. I want that if the health is not enough the warrior steps one back and rest but of I use this code I see a message that I can only perform one action at the time
[07:32:24] roelof: how to solve this ?
[07:32:36] dminuoso: roelof: Do you have a ruby specific question?
[07:32:37] nachoman: has joined #ruby
[07:33:26] roelof: yep . how I can make this work in ruby. I try to learn some ruby by using this site
[07:35:25] KeyJoo: has joined #ruby
[07:35:25] dminuoso: roelof: Your question is too general. Perhaps you are biting off more than you can chew?
[07:35:50] roelof: it can be
[07:36:08] roelof: other recommendations for the first steps in ruby ?
[07:36:24] stoffus: has joined #ruby
[07:36:59] dminuoso: roelof: The book "Well Grounded Rubyist" is a frequently recommended books for beginners to Ruby and programming.
[07:37:25] tAn: has joined #ruby
[07:41:41] ramfjord: has joined #ruby
[07:42:36] karapetyan: has joined #ruby
[07:44:35] hahuang65_: has joined #ruby
[07:45:34] burgestrand: has joined #ruby
[07:47:49] ramfjord: has joined #ruby
[07:48:16] mtkd: has joined #ruby
[07:52:17] Bish: has joined #ruby
[07:54:04] ramfjord: has joined #ruby
[07:57:05] alfiemax: has joined #ruby
[07:57:34] conta1: has joined #ruby
[07:57:51] duckpuppy: has joined #ruby
[07:58:47] za1b1tsu: has joined #ruby
[08:00:53] gh: has joined #ruby
[08:00:59] alfiemax: has joined #ruby
[08:06:32] schneider: has joined #ruby
[08:06:43] clemens3: has joined #ruby
[08:10:55] alexis: has joined #ruby
[08:11:43] n008f4g_: has joined #ruby
[08:12:42] banisterfiend: has joined #ruby
[08:16:33] aufi: has joined #ruby
[08:17:24] tomphp: has joined #ruby
[08:17:57] TomyWork: has joined #ruby
[08:24:20] suukim: has joined #ruby
[08:24:24] claudiuinberlin: has joined #ruby
[08:25:43] viuo: has joined #ruby
[08:25:48] yohji: has joined #ruby
[08:27:30] cdg: has joined #ruby
[08:29:36] schneider: has joined #ruby
[08:32:02] oetjenj: has joined #ruby
[08:37:45] amelliaa: has joined #ruby
[08:38:23] sameerynho: has joined #ruby
[08:43:01] Sylario: has joined #ruby
[08:43:29] marr: has joined #ruby
[08:43:46] willmichael: has joined #ruby
[08:46:23] aupadhye: has joined #ruby
[08:50:51] duckpuppy: has joined #ruby
[08:51:39] jottr: has joined #ruby
[08:51:47] alfiemax: has joined #ruby
[08:57:15] alfiemax: has joined #ruby
[09:02:38] mikecmpbll: has joined #ruby
[09:03:22] Railroad: has joined #ruby
[09:03:31] Railroad: I heard ruby was the next big thing
[09:04:24] tomphp: has joined #ruby
[09:12:28] z3uS: has joined #ruby
[09:13:03] RougeR: has joined #ruby
[09:13:04] RougeR: has joined #ruby
[09:14:01] mtkd: has joined #ruby
[09:15:33] oetjenj: has joined #ruby
[09:18:58] d^sh: has joined #ruby
[09:21:23] burgestrand: has joined #ruby
[09:22:46] cdg: has joined #ruby
[09:23:16] phaul: has joined #ruby
[09:24:31] ramfjord: has joined #ruby
[09:25:59] guille-moe: has joined #ruby
[09:26:54] ss942: has joined #ruby
[09:27:55] ss942: funny behaviour when I type ruby -v as a root it says me 2.5.0 when I type this with casual user it says ruby is not installed
[09:28:00] ss942: what the hell?
[09:28:13] qba73: has joined #ruby
[09:28:20] WhereIsMySpoon: has joined #ruby
[09:29:19] alfiemax: has joined #ruby
[09:29:42] dminuoso: ss942: different PATH environment variables probably.
[09:30:20] qba73: has joined #ruby
[09:30:25] ramfjord: has joined #ruby
[09:30:41] dminuoso: ss942: "ruby is not installed" just means "I was not able to find an executable named `ruby` in any of the directories specified in PATH"
[09:30:48] willmichael: has joined #ruby
[09:31:38] karapetyan: has joined #ruby
[09:32:24] cdg: has joined #ruby
[09:32:42] WhereIsMySpoon_: has joined #ruby
[09:33:59] cdg_: has joined #ruby
[09:36:39] ramfjord: has joined #ruby
[09:36:59] burgestrand: has joined #ruby
[09:37:33] cdg__: has joined #ruby
[09:38:46] workmad3_: has joined #ruby
[09:39:05] WhereIsMySpoon: Burgestrand: hey :) wonder if you’re up for solving a little conundrum I’ve come up against again? :)
[09:39:46] burgestrand: WhereIsMySpoon part of the deal is that you invite everybody to solve it and not just me :) i.e. post it in here and hope for luck
[09:40:06] burgestrand: No promises from my side, slightly more busy today!
[09:41:01] WhereIsMySpoon: Alright then, the output of the EasyAudio::Stream is buffers of floats. I (and burg who was helping me yesterday) figured it would be floats -1 to +1, however it seems to be of a larger range…I”m getting numbers from +7 to -6 or so even by moderately raising my voice
[09:41:26] WhereIsMySpoon: Wondering what the heck these numbers are…from the code its definitely amplitude, but why its not measuring in -1 to +1 I have no idea
[09:41:34] WhereIsMySpoon: Tis quite confusing
[09:42:53] riotjones: has joined #ruby
[09:43:51] ramfjord: has joined #ruby
[09:46:03] mikecmpb_: has joined #ruby
[09:47:02] karapetyan: has joined #ruby
[09:49:06] shuforov: has joined #ruby
[09:53:06] rabajaj: has joined #ruby
[09:56:00] qba73: has joined #ruby
[09:56:09] duckpuppy: has joined #ruby
[09:56:13] Guest33581: has joined #ruby
[09:57:49] snapcase: has joined #ruby
[09:58:55] viuo: has left #ruby: ()
[09:59:28] alex``: has joined #ruby
[10:01:24] KeyJoo: has joined #ruby
[10:02:50] yosafbridge: has joined #ruby
[10:06:16] burgestrand: has joined #ruby
[10:06:47] burgestrand: WhereIsMySpoon your audio library should tell you what the range is I believe, i.e. portaudio docs, if they don't it's probably some standard format
[10:09:28] WhereIsMySpoon: Burgestrand: EasyAudio is sending stream[:sampleFormat] = API::Float32 as the format, which is defined in ffi-portaudio as 0x1
[10:09:40] WhereIsMySpoon: which looks like it should just be -1 to +1 values
[10:09:50] WhereIsMySpoon: there are very little docs for these libs
[10:10:45] sidx64: has joined #ruby
[10:11:36] howdoi: has joined #ruby
[10:19:22] Serpent7776: has joined #ruby
[10:22:08] armando: has joined #ruby
[10:24:44] mikecmpbll: has joined #ruby
[10:27:28] tomphp: has joined #ruby
[10:28:24] mikecmpbll: has joined #ruby
[10:28:32] gnufied: has joined #ruby
[10:31:27] cdg: has joined #ruby
[10:35:02] shuforov: has joined #ruby
[10:35:48] toks: has joined #ruby
[10:37:57] ramfjord: has joined #ruby
[10:41:05] burgestrand: has joined #ruby
[10:43:04] c0ncealed: has joined #ruby
[10:46:58] guardianx: has joined #ruby
[10:50:25] hfp_work: has joined #ruby
[10:56:43] duckpuppy: has joined #ruby
[10:59:24] dviola: has joined #ruby
[11:30:31] nachoman: has joined #ruby
[11:32:22] Psybur: has joined #ruby
[11:32:23] Cavallari: has joined #ruby
[11:32:44] jimmylu2333: has joined #ruby
[11:38:09] tomphp: has joined #ruby
[11:42:30] Ryzokuken: has joined #ruby
[11:43:44] jeffreylevesque: has joined #ruby
[11:43:46] ldnunes: has joined #ruby
[11:44:58] am55: has joined #ruby
[11:46:54] tomphp: has joined #ruby
[11:51:37] AJA4350: has joined #ruby
[11:52:03] duckpuppy: has joined #ruby
[11:53:08] qba73: has joined #ruby
[11:54:37] roelof: has joined #ruby
[11:55:03] roelof: Where can I the best ask question if im stuck with ruby warriors
[11:58:49] plasmik: has joined #ruby
[12:01:19] banisterfiend: has joined #ruby
[12:02:03] plasmik: I need to compile some C-Ruby stuff, it has 'require mkmf' line, and this mkmf file spits errors and tells me to install developer tools
[12:02:46] plasmik: I am in msys2, ruby 2.4.0
[12:02:46] tomphp: has joined #ruby
[12:03:34] plasmik: developer tools are outdated for me
[12:04:57] jamesaxl: has joined #ruby
[12:04:59] plasmik: though project is made for Ruby 1.8.2
[12:05:30] jcalla: has joined #ruby
[12:05:31] tcopeland: has joined #ruby
[12:05:44] plasmik: mkmf.rb file is part of ruby installation
[12:08:46] rfoust: has joined #ruby
[12:09:35] gnufied: has joined #ruby
[12:10:19] ss942: has left #ruby: ()
[12:10:24] milardovich: has joined #ruby
[12:10:37] Psybur: has joined #ruby
[12:14:54] John_Ivan: has joined #ruby
[12:16:39] karapetyan: has joined #ruby
[12:17:02] ghcaf: has joined #ruby
[12:18:54] synthroid: has joined #ruby
[12:19:04] karapetyan: has joined #ruby
[12:19:41] dcluna: has joined #ruby
[12:20:06] jimmylu2333: has joined #ruby
[12:22:15] belmoussaoui: has joined #ruby
[12:22:49] stoffus1: has joined #ruby
[12:23:30] perzival: has joined #ruby
[12:23:35] karapetyan: has joined #ruby
[12:28:15] ramfjord: has joined #ruby
[12:33:46] goatish: has joined #ruby
[12:34:37] sidx64: has joined #ruby
[12:34:51] ramfjord: has joined #ruby
[12:35:09] willmichael: has joined #ruby
[12:38:23] DTZUZO: has joined #ruby
[12:39:00] cdg: has joined #ruby
[12:40:47] mtkd: has joined #ruby
[12:40:56] mydog2: has joined #ruby
[12:41:32] minimalism: has joined #ruby
[12:45:31] karapetyan: has joined #ruby
[12:47:47] roelof: good afternoon here
[12:48:28] phaul: pretty miserable afternoon here
[12:48:56] roelof: here too. the whole day rain , rain and rain
[12:51:17] bmurt: has joined #ruby
[12:52:36] duckpuppy: has joined #ruby
[12:52:53] psychicist__: has joined #ruby
[12:52:55] bmurt: has joined #ruby
[12:58:42] tomphp: has joined #ruby
[12:59:20] burgestrand: has joined #ruby
[13:01:21] banisterfiend: has joined #ruby
[13:02:38] milardovich: has joined #ruby
[13:06:08] goatish: has joined #ruby
[13:06:28] milardovich: has joined #ruby
[13:06:59] arquebus: has joined #ruby
[13:09:02] duckpuppy: has joined #ruby
[13:09:49] arup_r: has joined #ruby
[13:11:20] arup_r: I want to match if a string contains upper case, lower case, and numeric characters. What I tried http://rubular.com/r/vHGcQmx3l7 is wrong. What is the correct regex ?
[13:13:30] pastorinni: has joined #ruby
[13:14:59] dminuoso: arup_r: It matches..
[13:15:10] phaul: you have lower case z where you meant upper case? otherwise you get a match if your regexp matches any part of the string. I'm guessing you want too match if the regexp matches the entire string. to do that use begin string end string anchors in the regexp \A, \z
[13:15:25] phaul: s/too/to/
[13:15:26] arup_r: hm I want the string will contain only a-zA-Z0-9 nothing else
[13:15:32] mikecmpbll: has joined #ruby
[13:15:49] willmichael: has joined #ruby
[13:16:00] banisterfiend: has joined #ruby
[13:16:00] phaul: arup_r: what I said about matching the entire string ^^
[13:16:15] arup_r: right.. thanks phaul http://rubular.com/r/CU9TNBRvn8
[13:16:28] arquebus: has joined #ruby
[13:17:24] nowhereman_: has joined #ruby
[13:19:58] banisterfiend: has joined #ruby
[13:20:44] rippa: has joined #ruby
[13:21:40] karapetyan: has joined #ruby
[13:22:10] ramfjord: has joined #ruby
[13:22:40] dminuoso: Which drunken lord decided to use \A to signal beginning and \z to signal end?
[13:22:54] willmichael: has joined #ruby
[13:23:00] dminuoso: I mean considering ASCII codes fine I get it, but this is not intuitive.
[13:24:35] phaul: yeah, I always have to look up which one is upper :)
[13:24:53] milardovich: has joined #ruby
[13:25:21] phaul: most ppl just use ^ and $ without realizing that that's different semantics
[13:27:06] shuforov: has joined #ruby
[13:28:12] ramfjord: has joined #ruby
[13:29:16] milardovich: has joined #ruby
[13:30:59] rwb: has joined #ruby
[13:32:59] alex``: has joined #ruby
[13:33:59] milardovich: has joined #ruby
[13:35:24] nemesit|znc: anyone know how to get the json 1.8.1 gem to install on osx?
[13:38:43] mydog2: anyone here work on side projects for $$$
[13:39:02] mydog2: and happens to be in us/north america??
[13:42:36] schneider: has joined #ruby
[13:43:24] dminuoso: I dont work for three dollars.
[13:43:43] dminuoso: You'd have to spam a bit more to make it worth my while.
[13:49:59] kapil___: has joined #ruby
[13:52:16] duckpuppy: has joined #ruby
[13:52:30] allcentury: has joined #ruby
[13:53:02] griffindy: has joined #ruby
[13:53:15] milardovich: has joined #ruby
[13:53:30] jamesaxl: has joined #ruby
[13:54:57] rafik: has joined #ruby
[13:54:59] burgestrand: has joined #ruby
[13:57:30] banisterfiend: has joined #ruby
[13:57:38] tvw: has joined #ruby
[13:58:41] milardovich: has joined #ruby
[14:01:21] ryandevilla1: has joined #ruby
[14:01:36] Sr_X: has joined #ruby
[14:02:13] milardovich: has joined #ruby
[14:02:43] tomphp: has joined #ruby
[14:04:54] tomphp: has joined #ruby
[14:05:22] oleo: has joined #ruby
[14:07:26] Rapture: has joined #ruby
[14:08:26] samort7: has joined #ruby
[14:09:00] milardovich: has joined #ruby
[14:10:51] karapetyan: has joined #ruby
[14:11:37] karapetyan: has joined #ruby
[14:12:15] Psybur: has joined #ruby
[14:12:35] GinoMan: has joined #ruby
[14:12:58] mzo: has joined #ruby
[14:15:22] roshanavand: has joined #ruby
[14:15:49] netherwolfe: has joined #ruby
[14:16:49] qba73: has joined #ruby
[14:16:59] xuyuheng: has joined #ruby
[14:18:45] qba73: has joined #ruby
[14:19:49] ramfjord: has joined #ruby
[14:21:37] schneider: has joined #ruby
[14:22:24] morfin60: has joined #ruby
[14:27:04] morfin60: i am not sure how implement that: i have class A and classes B,C,D inherited from this class, all of them have method to parse all pages called collect_blocks of resource(pool) and i parse them until there is no output, this method is protected and used in multiple public methods of classes, any clue how can i pass code to process single page?
[14:28:30] morfin60: i realized how dumb was idea trying collect all blocks in huge array and want to rewrite code to process page-by-page
[14:29:55] chouhoulis: has joined #ruby
[14:30:42] burgestrand: has joined #ruby
[14:31:12] sriehl: has joined #ruby
[14:31:12] sriehl: has joined #ruby
[14:31:37] funnel: has joined #ruby
[14:36:56] mydog2: has left #ruby: ("Leaving")
[14:37:37] jamiejackson2577: has joined #ruby
[14:39:32] n0m4d1c: has joined #ruby
[14:41:01] kn-928: has joined #ruby
[14:41:50] TaintedTrust: has joined #ruby
[14:44:57] karapetyan: has joined #ruby
[14:45:35] karapetyan: has joined #ruby
[14:45:42] jeffreylevesque: has joined #ruby
[14:46:00] mtkd: has joined #ruby
[14:48:21] duckpuppy: has joined #ruby
[14:49:27] burgestrand: has joined #ruby
[14:50:09] milardovich: has joined #ruby
[14:52:39] rafik: has joined #ruby
[14:52:53] GinoMan: has joined #ruby
[14:57:17] shinnya: has joined #ruby
[14:59:14] mzo: has joined #ruby
[14:59:39] coderphive: has joined #ruby
[15:00:40] tomphp: has joined #ruby
[15:01:41] cschneid: has joined #ruby
[15:01:59] pastorinni: has joined #ruby
[15:02:21] rikkipitt: has joined #ruby
[15:03:12] GinoMan: has joined #ruby
[15:03:59] jeffreylevesque_: has joined #ruby
[15:07:06] jimmylu2333: has joined #ruby
[15:12:51] rikkipitt: has joined #ruby
[15:13:25] TaintedTrust: has joined #ruby
[15:14:22] nadir: has joined #ruby
[15:15:43] qba73: has joined #ruby
[15:19:19] bmurt: has joined #ruby
[15:20:54] guacamole: has joined #ruby
[15:20:54] guacamole: has joined #ruby
[15:22:51] fiachetti: has joined #ruby
[15:25:45] milardovich: has joined #ruby
[15:27:21] ramfjord: has joined #ruby
[15:28:02] yrstrly: has joined #ruby
[15:29:39] yrstrly: Hi, could somebody help me? Got a really basic question about classes I have these two classes : https://imgur.com/a/g4L6N and when I run these code lines Todolist.new, Todo.new("get the milk"), @to_do_list.add(@to_do), I get the error undefined method `add' for nil:NilClass (NoMethodError) even though it's clearly defined in the class and is being applied to an instance of the class
[15:30:08] schneider: has joined #ruby
[15:33:19] ramfjord: has joined #ruby
[15:39:31] ramfjord: has joined #ruby
[15:39:40] xuyuheng: has joined #ruby
[15:40:28] mzo: yrstrly: @to_do_list only exists within the Todolist class
[15:40:42] mzo: it's an instance variable
[15:41:28] mzo: even if it did exist, it's just an array. not a Todolist. so you wouldn't call .add on it
[15:42:04] yrstrly: yes but the method add is defined in that class too
[15:42:11] yrstrly: so why can't I add it?
[15:42:25] za1b1tsu: has joined #ruby
[15:42:26] mzo: you can call .add on an instance of the Todolist class. nothing else.
[15:42:49] mzo: @to_do_list is not an instance of the Todolist class, so you can't call .add on it.
[15:43:02] synthroid: has joined #ruby
[15:43:34] synthroid: has joined #ruby
[15:43:35] yrstrly: why is it not? it's defined in the initialize method for the class, so whenever Todolist.new is entered @to_do_list, an instance of the class Todolist, which is an empty array, will be created?
[15:43:54] yrstrly: I need to change the push in the method definition?
[15:44:23] mzo: within the context of the Todolist class, @to_do_list is an Array
[15:44:35] mzo: outside of the context of the Todolist class, @to_do_list is not anything.
[15:44:45] mzo: that's why it evaluates to nil
[15:45:07] mzo: there is no context where @to_do_list is an instance of the Todolist class
[15:45:10] Silthias: has joined #ruby
[15:45:52] phaul: instance variables despite the name don't point to intances :)
[15:47:38] schneider: has joined #ruby
[15:48:15] duckpuppy: has joined #ruby
[15:49:56] tolerablyjake: has joined #ruby
[15:51:10] WhereIsMySpoon: fucks sake this stupid goddamn library is doing my head in
[15:51:18] cagomez: has joined #ruby
[15:51:50] WhereIsMySpoon: im trying to use easy_audio https://github.com/lsegal/easy_audio and im just getting hangs like 70% of the time I try to close an EasyAudio::Stream object
[15:54:01] yrstrly: okay I think I understand, so what can I do to change my code so it works?
[15:54:32] wnd-trans: has joined #ruby
[15:54:56] ldnunes: has joined #ruby
[15:55:27] iamdevnul_: has joined #ruby
[15:55:32] mr-robert_: has joined #ruby
[15:56:04] nowhere_man: has joined #ruby
[15:56:06] Silthias: has left #ruby: ()
[15:56:07] musl_: has joined #ruby
[15:56:16] Fraeon: has joined #ruby
[15:56:27] ghoti_: has joined #ruby
[15:56:52] phaul: yrstrly: If you want your code to be debugged, paste the whole thing in a gist. see topic.
[15:57:14] jackjackdripper: has joined #ruby
[15:57:39] Xeago_: has joined #ruby
[15:57:41] knight_: has joined #ruby
[15:57:42] stairmast0r: has joined #ruby
[15:57:42] burgestrand: has joined #ruby
[15:58:04] atta_: has joined #ruby
[15:58:14] MarcWeber: has joined #ruby
[15:58:16] ccooke_: has joined #ruby
[15:58:34] sjums: has joined #ruby
[15:58:37] balo_: has joined #ruby
[15:59:30] KeyJoo: has joined #ruby
[15:59:39] yrstrly: https://gist.github.com/mattb20/8058a970219136a27d0955483849153a
[16:00:06] yrstrly: I'd just like to know how to properly generate an instance, if I've not done it correctly, as I understood it, if you call Todolist.new, you'll have an empty array assigned to variable @to_do_list
[16:01:20] phaul: x = TodoList.new ; x.add(Todo.new('get milk'))
[16:01:36] segy_: has joined #ruby
[16:01:51] DTZUZO: has joined #ruby
[16:01:52] phaul: you can factor out the call to Todo.new into a local variable too, just like x
[16:03:07] cyberRodent_: has joined #ruby
[16:03:07] brodul_: has joined #ruby
[16:03:08] amitchellbullard: has joined #ruby
[16:03:59] biox: has joined #ruby
[16:04:04] erlend: has joined #ruby
[16:04:04] badeball: has joined #ruby
[16:04:30] gbailey: has joined #ruby
[16:04:32] yrstrly: Thanks phaul, so there's nothing wrong with how I've defined the classes and methods?
[16:05:12] zachary12: has joined #ruby
[16:05:12] ericmathison: has joined #ruby
[16:05:35] VladGh: has joined #ruby
[16:06:13] phaul: bad indentations :)
[16:06:40] GinoMan: has joined #ruby
[16:07:16] cschneid: has joined #ruby
[16:07:32] phaul: I think it's fine
[16:07:34] schneider: has joined #ruby
[16:07:36] sidx64: has joined #ruby
[16:07:48] sriehl: has joined #ruby
[16:07:49] sriehl: has joined #ruby
[16:07:54] cdg: has joined #ruby
[16:07:57] naquad: has joined #ruby
[16:08:15] halbbalda: has joined #ruby
[16:09:07] coffeejunk: has joined #ruby
[16:09:26] yrstrly: It now runs, but when I call add and then print the array, it hasn't been pushed into it
[16:09:27] jcarl43: has joined #ruby
[16:09:30] yrstrly: It's still empty
[16:09:47] rikkipitt: has joined #ruby
[16:10:19] HalcyonicStorm: has joined #ruby
[16:10:53] Lloyd: has joined #ruby
[16:10:54] nettie: has joined #ruby
[16:11:08] Fenhl: has joined #ruby
[16:11:13] cdg_: has joined #ruby
[16:11:17] auv: has joined #ruby
[16:11:49] tAn: has joined #ruby
[16:12:42] mtkd: has joined #ruby
[16:12:51] dn`: has joined #ruby
[16:13:25] xuyuheng: has joined #ruby
[16:14:25] phaul: yrstrly: https://gist.github.com/phaul/26e90ba0f7b99ecaca5e4523c2e285f5
[16:14:53] phaul: I also removed the unneeded Array inharitance
[16:16:29] yrstrly: thanks very much
[16:19:00] ncopa2: has joined #ruby
[16:20:43] Jeff_D: has joined #ruby
[16:21:55] jamiejackson2577: has joined #ruby
[16:23:49] Jeff_D: Can someone point me to equivalent Ruby code for the `gem install --explain` command? Capturing and scraping terminal output doesn't seem like the best way forward
[16:23:55] yadnesh: has joined #ruby
[16:24:45] guacamole: has joined #ruby
[16:24:53] guacamole: has joined #ruby
[16:25:51] orbyt_: has joined #ruby
[16:27:32] xuyuheng: has joined #ruby
[16:27:58] jamiejackson2577: has joined #ruby
[16:28:18] havenwood: Jeff_D: For example, try: Gem::Specification.find_by_name('rails').dependencies.map(&:to_s)
[16:29:18] ramfjord: has joined #ruby
[16:29:28] Jeff_D: ah; thank you very much
[16:30:45] imode: has joined #ruby
[16:32:15] za1b1tsu: has joined #ruby
[16:32:38] GinoMan: has joined #ruby
[16:33:01] Ryzokuken: has joined #ruby
[16:37:00] darkhanb: has joined #ruby
[16:38:44] blzn: has joined #ruby
[16:38:47] yxhuvud: has joined #ruby
[16:42:58] redondos: has joined #ruby
[16:45:10] xuyuheng: has joined #ruby
[16:45:11] qba73: has joined #ruby
[16:50:03] tAn: has joined #ruby
[16:50:26] willmichael: has joined #ruby
[16:52:30] Jeff_D: @havenwood Thanks for that; I was looking for something that does the equivalent of, say, `gem install rails --explain`, which lists specific versions of dependencies, dependencies of dependencies, and so on; it seems odd that I have to walk the dependency tree and build a gem list explicitly. But if that's what it takes, oh well
[16:52:48] WhereIsMySpoon: has joined #ruby
[16:56:22] duckpuppy: has joined #ruby
[16:56:31] synthroid: has joined #ruby
[16:56:44] Quentinius: has joined #ruby
[16:58:41] roshanavand: has joined #ruby
[16:59:27] xuyuheng: has joined #ruby
[17:00:44] psychicist__: has joined #ruby
[17:01:11] eckhardt: has joined #ruby
[17:05:25] fiachetti: has joined #ruby
[17:10:06] ryandevilla1: has joined #ruby
[17:10:59] qba73: has joined #ruby
[17:12:41] WhereIsMySpoon: has joined #ruby
[17:12:41] WhereIsMySpoon: has joined #ruby
[17:14:07] xuyuheng: has joined #ruby
[17:14:16] ski7777: has joined #ruby
[17:15:20] GinoMan2440: has joined #ruby
[17:16:02] willmichael: has joined #ruby
[17:17:49] tAn: has joined #ruby
[17:19:15] guacamole: has joined #ruby
[17:19:34] ramfjord: has joined #ruby
[17:22:09] Dimik: has joined #ruby
[17:23:20] desperek: has joined #ruby
[17:24:55] amelliaa: has joined #ruby
[17:25:58] ramfjord: has joined #ruby
[17:26:12] sameerynho: has joined #ruby
[17:27:50] psychicist__: has joined #ruby
[17:30:41] guacamole: has joined #ruby
[17:30:41] guacamole: has joined #ruby
[17:32:00] yadnesh: has joined #ruby
[17:32:12] tomphp: has joined #ruby
[17:33:18] xuyuheng: has joined #ruby
[17:36:31] clemens3: has joined #ruby
[17:37:05] psychicist__: has joined #ruby
[17:38:04] alfiemax: has joined #ruby
[17:38:52] guacamole: has joined #ruby
[17:38:52] guacamole: has joined #ruby
[17:39:13] \void: has joined #ruby
[17:42:15] tomphp: has joined #ruby
[17:49:06] ramfjord: has joined #ruby
[17:49:09] workmad3: has joined #ruby
[17:49:10] ski7777: has joined #ruby
[17:49:28] duckpuppy: has joined #ruby
[17:52:00] snapcase: has joined #ruby
[17:52:36] GinoMan2440: has joined #ruby
[17:56:08] xuyuheng: has joined #ruby
[17:56:12] jamesaxl: has joined #ruby
[17:56:24] GinoMan2440: has joined #ruby
[17:56:35] tAn: has joined #ruby
[18:02:28] ski7777: has joined #ruby
[18:05:04] willmichael: has joined #ruby
[18:06:27] _main_: has joined #ruby
[18:06:44] n0m4d1c: has joined #ruby
[18:09:35] pilne: has joined #ruby
[18:12:26] erlend: has joined #ruby
[18:12:50] n0m4d1c_: has joined #ruby
[18:14:01] cagomez: has joined #ruby
[18:16:24] xuyuheng: has joined #ruby
[18:16:45] za1b1tsu: Anybody using ruby language server protocol with vim?
[18:18:33] KeyJoo: has joined #ruby
[18:20:06] tomphp: has joined #ruby
[18:22:08] n0m4d1c: has joined #ruby
[18:23:11] Zaab1t: has joined #ruby
[18:24:55] WhereIsMySpoon: has joined #ruby
[18:24:55] WhereIsMySpoon: has joined #ruby
[18:26:04] am55: has joined #ruby
[18:27:46] ramfjord: has joined #ruby
[18:28:02] ldnunes: has joined #ruby
[18:29:53] synthroid: has joined #ruby
[18:33:41] ramfjord: has joined #ruby
[18:33:47] n008f4g_: has joined #ruby
[18:35:39] deadnull: has joined #ruby
[18:35:50] rfoust: has joined #ruby
[18:37:52] tAn: has joined #ruby
[18:39:39] shuforov: has joined #ruby
[18:39:41] ramfjord: has joined #ruby
[18:40:27] tAn: has joined #ruby
[18:40:40] tomphp: has joined #ruby
[18:41:08] tAn: has joined #ruby
[18:41:54] bmurt: has joined #ruby
[18:43:54] tAn: has joined #ruby
[18:44:18] GinoMan: has joined #ruby
[18:45:39] ramfjord: has joined #ruby
[18:47:13] tomphp: has joined #ruby
[18:53:18] ramfjord: has joined #ruby
[18:53:34] duckpuppy: has joined #ruby
[18:55:01] noizex: has joined #ruby
[18:57:10] xuyuheng: has joined #ruby
[18:59:11] ramfjord: has joined #ruby
[19:00:04] mikecmpbll: has joined #ruby
[19:00:19] karapetyan: has joined #ruby
[19:01:26] jenrzzz: has joined #ruby
[19:01:26] jenrzzz: has joined #ruby
[19:03:26] pastorinni: has joined #ruby
[19:04:04] dtzuzu: has joined #ruby
[19:05:01] GinoMan: has joined #ruby
[19:05:19] ramfjord: has joined #ruby
[19:05:47] nadir: has joined #ruby
[19:06:44] za1b1tsu: asyncomplete is much slower then mucomplete, how is that even possible
[19:07:59] ryandevilla1: has joined #ruby
[19:10:05] chouhoul_: has joined #ruby
[19:11:16] ramfjord: has joined #ruby
[19:13:46] DTZUZO: has joined #ruby
[19:15:28] psychicist__: has joined #ruby
[19:17:15] Lyubo1: has joined #ruby
[19:17:18] ramfjord: has joined #ruby
[19:17:25] xuyuheng: has joined #ruby
[19:17:28] alex``: has joined #ruby
[19:19:42] perc1val: has joined #ruby
[19:22:12] bmurt: has joined #ruby
[19:22:15] nowhereman_: has joined #ruby
[19:28:12] jackjackdripper: has joined #ruby
[19:31:51] pwelch: has joined #ruby
[19:32:32] xuyuheng: has joined #ruby
[19:34:57] mwlang: has joined #ruby
[19:36:41] karapetyan: has joined #ruby
[19:38:22] n0m4d1c: has joined #ruby
[19:45:16] n0m4d1c_: has joined #ruby
[19:46:35] tolerablyjake: has joined #ruby
[19:52:28] xuyuheng: has joined #ruby
[19:52:59] ryandevilla1: has joined #ruby
[19:55:52] cagomez: has joined #ruby
[19:56:34] rafik: has joined #ruby
[19:57:01] duckpuppy: has joined #ruby
[19:58:45] jenrzzz_: has joined #ruby
[19:59:13] cagomez: has joined #ruby
[20:03:53] cagomez: has joined #ruby
[20:04:56] ramfjord: has joined #ruby
[20:06:08] gizmore: made a new hacking challenge... training programming level 3/10 : https://www.wechall.net/en/challenge/britcoin/
[20:06:25] gizmore: maybe someone here likes it
[20:06:40] gizmore: sorry for off-topic
[20:11:47] RougeR: has joined #ruby
[20:12:27] tAn: has joined #ruby
[20:12:44] xuyuheng: has joined #ruby
[20:14:04] shuforov: has joined #ruby
[20:14:37] anisha: has joined #ruby
[20:18:45] klaas: has joined #ruby
[20:21:12] erlend: has joined #ruby
[20:22:32] n0m4d1c: has joined #ruby
[20:24:11] ski7777: has joined #ruby
[20:25:15] ski4x7: has joined #ruby
[20:26:41] willmichael: has joined #ruby
[20:28:53] vcavallo: has joined #ruby
[20:31:55] Rapture: has joined #ruby
[20:32:06] tomphp: has joined #ruby
[20:32:53] eckhardt: has joined #ruby
[20:33:07] xuyuheng: has joined #ruby
[20:34:01] claudiuinberlin: has joined #ruby
[20:34:22] chouhoulis: has joined #ruby
[20:35:09] n0m4d1c_: has joined #ruby
[20:38:45] Sr_X: has joined #ruby
[20:41:02] cagomez: has joined #ruby
[20:42:10] cagomez: has joined #ruby
[20:42:43] Bounga: has joined #ruby
[20:42:56] n0m4d1c: has joined #ruby
[20:44:41] SeepingN: has joined #ruby
[20:48:21] cagomez: has joined #ruby
[20:50:00] mrBen2k2k2k__: has joined #ruby
[20:52:07] duckpuppy: has joined #ruby
[20:53:22] xuyuheng: has joined #ruby
[20:54:19] cagomez: has joined #ruby
[20:56:10] tomphp: has joined #ruby
[20:56:26] ldnunes: has joined #ruby
[21:00:01] llua: has joined #ruby
[21:04:36] n0m4d1c_: has joined #ruby
[21:05:07] ramfjord: has joined #ruby
[21:07:10] karapetyan: has joined #ruby
[21:12:43] eckhardt: has joined #ruby
[21:13:37] xuyuheng: has joined #ruby
[21:14:45] jeffreylevesque: has joined #ruby
[21:26:07] rafik: has joined #ruby
[21:26:14] workmad3: has joined #ruby
[21:26:25] xuyuheng: has joined #ruby
[21:33:57] milardovich: has joined #ruby
[21:35:18] claudiuinberlin: has joined #ruby
[21:37:34] Mike11: has joined #ruby
[21:45:42] alex``: has joined #ruby
[21:46:39] xuyuheng: has joined #ruby
[21:50:55] duckpuppy: has joined #ruby
[21:53:19] raynold: has joined #ruby
[21:54:00] gizmore: has joined #ruby
[21:56:05] kt: has joined #ruby
[21:57:07] IshMael_: has joined #ruby
[21:58:04] Azure: has joined #ruby
[21:58:05] cdg: has joined #ruby
[21:59:24] n0m4d1c: has joined #ruby
[22:02:02] ramfjord: has joined #ruby
[22:03:13] shpoont: has joined #ruby
[22:03:44] IshMael_: https://gist.github.com/anonymous/6f80c75f80c9beacac547ce21901f787
[22:04:11] duper: has joined #ruby
[22:04:12] IshMael_: Can someone explain to me, why there isnt a self on the key?(method_name) on the second line?
[22:05:53] jenrzzz: has joined #ruby
[22:05:54] phaul: IshMael_: it's about what self is. If you have time watch https://youtu.be/X2sgQ38UDVY, that should explain what self is
[22:06:11] phaul: but it's a lot more than what you are asking
[22:06:51] IshMael_: phaul: yep try to get it in my head ;) but on that example i got stuck
[22:07:03] xuyuheng: has joined #ruby
[22:07:53] IshMael_: has joined #ruby
[22:07:53] Mike11: has joined #ruby
[22:07:53] Rapture: has joined #ruby
[22:07:54] willmichael: has joined #ruby
[22:07:54] auv: has joined #ruby
[22:07:54] nettie: has joined #ruby
[22:07:54] Lloyd: has joined #ruby
[22:07:54] gbailey: has joined #ruby
[22:07:54] biox: has joined #ruby
[22:07:54] funnel: has joined #ruby
[22:07:54] belmoussaoui: has joined #ruby
[22:07:54] dcluna: has joined #ruby
[22:07:54] WhereIsMySpoon_: has joined #ruby
[22:07:54] hahuang65_: has joined #ruby
[22:07:54] jordanm: has joined #ruby
[22:07:54] unreal_: has joined #ruby
[22:07:54] ghormoon: has joined #ruby
[22:07:54] jrm: has joined #ruby
[22:07:54] jinie: has joined #ruby
[22:07:54] oz: has joined #ruby
[22:07:54] cjohnson: has joined #ruby
[22:07:54] `derpy: has joined #ruby
[22:07:54] rideh: has joined #ruby
[22:07:54] EXCHGR: has joined #ruby
[22:07:54] m27frogy: has joined #ruby
[22:07:54] rubemlrm: has joined #ruby
[22:07:54] volix: has joined #ruby
[22:07:54] Tempesta: has joined #ruby
[22:07:54] p0p0pr37: has joined #ruby
[22:07:55] boshhead: has joined #ruby
[22:07:55] morfin: has joined #ruby
[22:07:55] mahlon: has joined #ruby
[22:07:55] madhatter: has joined #ruby
[22:07:55] havenwood: has joined #ruby
[22:07:55] ciscam: has joined #ruby
[22:07:55] linduxed: has joined #ruby
[22:07:55] Exagone313: has joined #ruby
[22:07:55] ByronJohnson: has joined #ruby
[22:07:55] justinmcp: has joined #ruby
[22:08:09] rafik: has joined #ruby
[22:08:40] ghormoon: has joined #ruby
[22:09:02] funnel: has joined #ruby
[22:09:11] belmoussaoui: has joined #ruby
[22:09:34] jottr: has joined #ruby
[22:09:42] phaul: basically your gist has too little to tell what self is. But when you are inside a def inside a class statement self would refer to the instance of the class that receives the instance method.
[22:09:48] Tempesta: has joined #ruby
[22:09:54] Tempesta: has joined #ruby
[22:09:57] phaul: when a receiver is self most of the time it can be omitted
[22:10:00] jrm: has joined #ruby
[22:10:29] IshMael_: phaul: thanks for the link to the video , but watched that already a few times
[22:10:32] phaul: it can'tbe ommited in certain cases, when the syntax confuses the interpreter, like slef.class
[22:10:44] phaul: self.class
[22:10:51] auv: has joined #ruby
[22:10:54] phaul: class would otherwise be a keyword
[22:10:58] apeiros: or self.foo =
[22:11:35] ldepandis: has joined #ruby
[22:11:39] IshMael_: phaul: the code is from the Hashie GEM , which is an example from the book "Metaprogramming Ruby 2" by Paolo Perrotta
[22:12:11] epochwolf: has joined #ruby
[22:12:14] d^sh: has joined #ruby
[22:12:18] trautwein: has joined #ruby
[22:12:30] yadnesh: has joined #ruby
[22:12:30] Xeago: has joined #ruby
[22:12:33] Exagone313: has joined #ruby
[22:13:11] ResidentBiscuit: has joined #ruby
[22:13:11] IshMael_: so i just wondered why there is a self.[] when i also can access the keys in that hash without the self in front
[22:14:19] phaul: [] requires self because the intrepreter doesn't like a bare [] operator without a receiver it. key? is fine with an implicit receiver. It's mostly just syntax really
[22:14:53] shpoont: has joined #ruby
[22:15:01] IshMael_: phaul .. that seems to clearify it. thanks for your time and help!
[22:15:36] apeiros: [] would be an array literal otherwise
[22:15:45] apeiros: but in the given case, there's also another reason
[22:16:04] apeiros: they don't use `self[arg1, arg2, …]` as one would usually do
[22:16:16] apeiros: they use `self.[](arg1, …)`, which is uncommon.
[22:16:42] apeiros: the reason being that they pass a block. and the syntax sugared form can't take one
[22:17:25] IshMael_: so far on "ruby is easily readable" :)
[22:17:28] atmosx: has left #ruby: ("WeeChat 1.4")
[22:17:40] apeiros: oh, actually it can when it's passed in &block form :-/
[22:18:03] apeiros: not sure then why they used `self.[](method_name, &blk)` instead of `self[method_name, &blk]`
[22:18:09] tcopeland: has joined #ruby
[22:18:17] apeiros: IshMael_: it mostly is. there are always tradeoffs.
[22:18:27] rafik: has joined #ruby
[22:19:05] IshMael_: apeiros: thats right! i took me not long to get into ruby. but well the topic metaprogramming and the concepts behind are sometimes like a hard, little nut until i can grasp it
[22:19:21] pastorinni: has joined #ruby
[22:19:27] xuyuheng: has joined #ruby
[22:19:38] apeiros: IshMael_: funny enough, it seems more complex than it actually is
[22:19:56] cdg: has joined #ruby
[22:19:57] IshMael_: apeiros: jep .., isnt that fun :-D
[22:20:07] apeiros: as weird as it is, it just takes a bit of time to unravel the simplicity ;-)
[22:20:15] jshjsh: has joined #ruby
[22:20:31] apeiros: (and accepting some of the "cheating" required to get it to work out)
[22:21:00] IshMael_: apeiros: i hope you are right .. i've just worked trough the first 60 pages, but that gave already a lot of insight. and im sure there is more to come
[22:21:11] apeiros: for example: there are no class methods in ruby, only instance methods. what people call class methods in ruby, are really just instance methods too.
[22:21:16] ledestin: has joined #ruby
[22:21:30] apeiros: i.e. there's not multiple "levels" where methods can exist, only one :)
[22:21:42] apeiros: and all you have to figure out is to which class/module a method belongs
[22:21:43] IshMael_: apeiros: yep, got that already. any class is an object too
[22:21:58] IshMael_: it just depends on the "point of view"
[22:22:43] phaul: altough lot tools like Yard calls them class methods, maybe even ri - I'm not sure
[22:22:49] IshMael_: method lookup (one step to the right and up) is learned
[22:23:16] apeiros: phaul: sure. it's convenient.
[22:23:16] phaul: I guess you just have to know that it's cheat and it's all fine :)
[22:23:25] apeiros: I call it class methods too
[22:23:35] apeiros: it's a lot shorter than instance method of the singleton_class
[22:23:40] IshMael_: phaul: what me got worried was that in the ruby source there seems to be a different name for eigenclasses(singleton classes) and metaclasses
[22:24:08] apeiros: ah, dminuoso can probably better explain that
[22:24:10] IshMael_: so first i thought that they are 2 totally differnt things, but they are not
[22:27:58] tomphp: has joined #ruby
[22:28:36] ResidentBiscuit: has joined #ruby
[22:29:23] erlend: has joined #ruby
[22:30:24] xuyuheng: has joined #ruby
[22:30:57] mtkd: has joined #ruby
[22:31:20] milardovich: has joined #ruby
[22:33:21] AndBobsYourUncle: has joined #ruby
[22:38:14] Sr_X: has joined #ruby
[22:39:15] vcavallo_: has joined #ruby
[22:41:48] rafik: has joined #ruby
[22:43:06] shpoont: has joined #ruby
[22:44:17] millerti: has joined #ruby
[22:50:23] xuyuheng: has joined #ruby
[22:50:43] duckpuppy: has joined #ruby
[22:53:11] phaul: ahoy matey
[22:53:40] rwb: has joined #ruby
[22:55:12] Asher: has joined #ruby
[22:59:37] ResidentBiscuit: has joined #ruby
[23:00:16] am55: has joined #ruby
[23:00:30] jenrzzz: has joined #ruby
[23:01:41] minimalism: has joined #ruby
[23:02:25] mtkd: has joined #ruby
[23:03:37] sspreitz: has joined #ruby
[23:06:40] Azure: has joined #ruby
[23:07:47] cdg: has joined #ruby
[23:08:41] Paraxial: has joined #ruby
[23:10:42] xuyuheng: has joined #ruby
[23:12:08] iszak: has joined #ruby
[23:12:34] ramfjord: has joined #ruby
[23:12:46] herbmillerjr: has joined #ruby
[23:14:16] Bounga: has joined #ruby
[23:14:30] rfoust: has joined #ruby
[23:22:09] Bounga: has joined #ruby
[23:23:14] ramfjord: has joined #ruby
[23:23:44] xuyuheng: has joined #ruby
[23:26:31] workmad3: has joined #ruby
[23:29:15] ramfjord: has joined #ruby
[23:31:04] alfiemax: has joined #ruby
[23:31:43] cschneid: has joined #ruby
[23:35:14] ramfjord: has joined #ruby
[23:35:40] Bounga: has joined #ruby
[23:35:58] Puffball: has joined #ruby
[23:42:34] ramfjord: has joined #ruby
[23:44:13] xuyuheng: has joined #ruby
[23:48:36] ramfjord: has joined #ruby
[23:48:39] milardovich: has joined #ruby
[23:50:50] ResidentBiscuit: has joined #ruby
[23:51:36] duckpuppy: has joined #ruby
[23:54:28] ramfjord: has joined #ruby
[23:58:24] Bounga: has joined #ruby