00:01
rhuang_ has joined #ruby
00:03
ElF3rn4 has joined #ruby
00:03
rhuang has quit [Ping timeout: 246 seconds]
00:03
tdy has quit [Ping timeout: 245 seconds]
00:03
ElF3rn4 has quit [Client Quit]
00:04
AlHafoudh has quit [Ping timeout: 258 seconds]
00:05
haengma has quit [Remote host closed the connection]
00:06
haengma has joined #ruby
00:08
haengma_ has joined #ruby
00:10
haengma has quit [Ping timeout: 245 seconds]
00:12
haengma_ has quit [Ping timeout: 248 seconds]
00:16
ricer2_yFYh has quit [Remote host closed the connection]
00:17
ramfjord has quit [Ping timeout: 255 seconds]
00:36
jmcgnh has joined #ruby
00:36
gix has quit [Ping timeout: 248 seconds]
00:37
cnsvc has quit [Ping timeout: 256 seconds]
00:38
jmcgnh has quit [Client Quit]
00:39
AlHafoudh has joined #ruby
00:46
mikecmpbll has quit [Quit: inabit. zz.]
00:46
symm- has quit [Ping timeout: 255 seconds]
00:46
brool has joined #ruby
00:49
jenrzzz has quit [Ping timeout: 248 seconds]
00:58
symm- has joined #ruby
01:01
carbone5 has joined #ruby
01:02
AlHafoudh has quit [Ping timeout: 248 seconds]
01:02
fphilipe_ has joined #ruby
01:02
mikeiniowa has quit [Remote host closed the connection]
01:03
mikeiniowa has joined #ruby
01:06
cnsvc has joined #ruby
01:06
zacts has joined #ruby
01:17
AJA4350 has quit [Quit: AJA4350]
01:18
jenrzzz has joined #ruby
01:25
altigraph has joined #ruby
01:29
agent_white has quit [Remote host closed the connection]
01:32
symm- has quit [Ping timeout: 246 seconds]
01:36
fphilipe_ has quit [Ping timeout: 252 seconds]
01:38
dsmythe has quit [Remote host closed the connection]
01:39
dsmythe has joined #ruby
01:41
rhuang_ has quit [Remote host closed the connection]
01:45
carbone5 has quit [Quit: carbone5]
01:49
zacts has quit [Quit: WeeChat 2.4]
01:49
duderonomy has joined #ruby
01:54
cnsvc has quit [Ping timeout: 256 seconds]
01:57
jenrzzz has quit [Ping timeout: 246 seconds]
02:04
jenrzzz has joined #ruby
02:14
Swyper has joined #ruby
02:18
def_jam has joined #ruby
02:18
eb0t has quit [Ping timeout: 245 seconds]
02:19
eb0t_ has joined #ruby
02:19
eblip has quit [Ping timeout: 246 seconds]
02:21
jenrzzz has quit [Ping timeout: 255 seconds]
02:30
cnsvc has joined #ruby
02:31
landakram has joined #ruby
02:34
pupsikov has joined #ruby
02:39
pupsikov has quit [Client Quit]
02:39
jmcgnh has joined #ruby
02:40
eb0t_ is now known as eb0t
02:40
jenrzzz has joined #ruby
02:42
jmcgnh has quit [Client Quit]
02:44
AlHafoudh has joined #ruby
02:48
landakram has quit [Ping timeout: 252 seconds]
02:49
AlHafoudh has quit [Ping timeout: 246 seconds]
03:00
millerti has quit [Ping timeout: 246 seconds]
03:01
gregf_ has quit [Ping timeout: 256 seconds]
03:05
jenrzzz has quit [Ping timeout: 255 seconds]
03:05
braincrash has quit [Quit: bye bye]
03:06
garyserj has quit [Ping timeout: 252 seconds]
03:07
weteamsteve1 has joined #ruby
03:09
jenrzzz has joined #ruby
03:09
weteamsteve has quit [Ping timeout: 248 seconds]
03:09
braincrash has joined #ruby
03:17
zacts has joined #ruby
03:22
jobewan has joined #ruby
03:26
jenrzzz has quit [Ping timeout: 258 seconds]
03:32
kapilp has joined #ruby
03:33
fphilipe_ has joined #ruby
03:34
zacts has quit [Quit: WeeChat 2.4]
03:35
jenrzzz has joined #ruby
03:45
brool has quit [Ping timeout: 258 seconds]
03:55
sauvin has joined #ruby
04:00
mochiyoda has left #ruby ["Konversation terminated!"]
04:06
AlHafoudh has joined #ruby
04:06
fphilipe_ has quit [Ping timeout: 248 seconds]
04:06
mozzarella has quit [Remote host closed the connection]
04:08
mozzarella has joined #ruby
04:11
AlHafoudh has quit [Ping timeout: 268 seconds]
04:12
mozzarella has quit [Remote host closed the connection]
04:15
mozzarella has joined #ruby
04:16
tdy has joined #ruby
04:18
DTZUZO has quit [Ping timeout: 255 seconds]
04:26
ramfjord has joined #ruby
04:30
ramfjord has quit [Ping timeout: 246 seconds]
04:35
fphilipe_ has joined #ruby
04:36
Xiti has quit [Quit: Xiti]
04:44
ur5us_ has quit [Remote host closed the connection]
04:45
ur5us has joined #ruby
04:49
ur5us has quit [Ping timeout: 246 seconds]
04:50
AlHafoudh has joined #ruby
04:52
weteamsteve1 has quit [Read error: Connection reset by peer]
04:55
AlHafoudh has quit [Ping timeout: 255 seconds]
04:57
nadir has quit [Quit: Connection closed for inactivity]
05:01
AlHafoudh has joined #ruby
05:06
AlHafoudh has quit [Ping timeout: 248 seconds]
05:06
haengma has joined #ruby
05:10
fphilipe_ has quit [Ping timeout: 258 seconds]
05:11
haengma has quit [Ping timeout: 246 seconds]
05:14
jenrzzz has quit [Ping timeout: 258 seconds]
05:17
AlHafoudh has joined #ruby
05:19
jenrzzz has joined #ruby
05:20
esrse has joined #ruby
05:21
conta has joined #ruby
05:22
fphilipe_ has joined #ruby
05:23
AlHafoudh has quit [Ping timeout: 246 seconds]
05:27
fphilipe_ has quit [Ping timeout: 258 seconds]
05:35
za1b1tsu has joined #ruby
05:36
SeepingN has quit [Quit: The system is going down for reboot NOW!]
05:39
fphilipe_ has joined #ruby
05:44
fphilipe_ has quit [Ping timeout: 252 seconds]
05:45
fphilipe_ has joined #ruby
05:45
AlHafoudh has joined #ruby
05:50
arup_r has joined #ruby
05:55
Inline has quit [Quit: Leaving]
05:59
reber has joined #ruby
06:00
reber has quit [Remote host closed the connection]
06:00
reber has joined #ruby
06:03
fphilipe_ has quit [Ping timeout: 258 seconds]
06:09
maryo has joined #ruby
06:19
AlHafoudh has joined #ruby
06:27
nowhereman has joined #ruby
06:27
Xiti has joined #ruby
06:30
jefffrails35 has joined #ruby
06:30
fphilipe_ has joined #ruby
06:30
nowhere_man has quit [Ping timeout: 245 seconds]
06:30
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
06:31
Yxhuvud has joined #ruby
06:32
nowhereman has quit [Ping timeout: 252 seconds]
06:37
cd has quit [Quit: cd]
06:39
andikr has joined #ruby
06:50
Puffball has joined #ruby
06:51
TomyWork has joined #ruby
06:52
Puffball has quit [Client Quit]
06:52
AlHafoudh has quit [Ping timeout: 268 seconds]
06:54
Puffball has joined #ruby
07:01
dar123 has joined #ruby
07:03
tdy has quit [Ping timeout: 258 seconds]
07:03
aupadhye has joined #ruby
07:04
dsmythe has quit [Remote host closed the connection]
07:05
dsmythe has joined #ruby
07:11
Puffball has quit [Quit: Puffball]
07:13
jenrzzz has quit [Ping timeout: 248 seconds]
07:15
evdubs has quit [Remote host closed the connection]
07:15
kyrylo has joined #ruby
07:15
evdubs has joined #ruby
07:15
clemens3 has joined #ruby
07:16
rippa has joined #ruby
07:22
haengma has joined #ruby
07:24
lxsameer has joined #ruby
07:27
haengma has quit [Ping timeout: 268 seconds]
07:31
AlHafoudh has joined #ruby
07:34
vondruch has joined #ruby
07:36
AlHafoudh has quit [Ping timeout: 245 seconds]
07:37
dellavg_ has joined #ruby
07:39
mikecmpbll has joined #ruby
07:43
tdy has joined #ruby
07:44
jobewan has quit [Quit: jobewan]
07:53
AlHafoudh has joined #ruby
07:54
cnsvc has quit [Ping timeout: 256 seconds]
07:59
AlHafoudh has quit [Ping timeout: 246 seconds]
08:03
conta has quit [Ping timeout: 268 seconds]
08:04
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
08:08
Ai9zO5AP has joined #ruby
08:17
AlHafoudh has joined #ruby
08:18
tdy has quit [Ping timeout: 252 seconds]
08:19
ellcs has joined #ruby
08:21
ricer2 has joined #ruby
08:26
ramfjord has joined #ruby
08:29
cnsvc has joined #ruby
08:30
eb0t has quit [Quit: WeeChat 2.3]
08:31
ramfjord has quit [Ping timeout: 255 seconds]
08:37
reber has quit [Read error: Connection reset by peer]
08:42
DTZUZO has joined #ruby
08:42
ur5us has joined #ruby
08:53
AlHafoudh has quit [Ping timeout: 258 seconds]
08:54
cnsvc has quit [Ping timeout: 256 seconds]
09:00
conta has joined #ruby
09:04
laaron has quit [Remote host closed the connection]
09:05
ua has quit [Ping timeout: 258 seconds]
09:06
laaron has joined #ruby
09:06
AlHafoudh has joined #ruby
09:07
ur5us has quit [Remote host closed the connection]
09:08
ur5us has joined #ruby
09:09
jenrzzz has joined #ruby
09:10
waheedi has joined #ruby
09:12
ur5us has quit [Ping timeout: 246 seconds]
09:14
jenrzzz has quit [Ping timeout: 248 seconds]
09:14
AlHafoudh has quit [Ping timeout: 246 seconds]
09:21
laaron has quit [Remote host closed the connection]
09:24
laaron has joined #ruby
09:25
AlHafoudh has joined #ruby
09:35
ua has joined #ruby
09:38
haengma has joined #ruby
09:42
haengma has quit [Ping timeout: 255 seconds]
09:46
cnsvc has joined #ruby
09:58
LnxBil has joined #ruby
09:59
<
LnxBil >
Hi everyone. Could someone explain why this is converted as it is?
09:59
<
LnxBil >
require 'yaml'; puts ({ 'a' => [ '22:22', '80:80' ] }.to_yaml).inspect
09:59
<
LnxBil >
"---\na:\n- '22:22'\n- 80:80\n"
09:59
<
LnxBil >
I wonder why the first element is always encapsulated
10:01
<
LnxBil >
Oh, it's the 22 that is always quoted, but why?
10:04
altigraph has quit [Ping timeout: 244 seconds]
10:04
<
leftylink >
&>> require 'yaml'; YAML.load("22:22")
10:04
<
leftylink >
amazing
10:05
AlHafoudh has quit [Ping timeout: 246 seconds]
10:09
<
LnxBil >
for octal representation (starting with 0) this is the default. The : is triggering this conversion somehow.
10:10
<
leftylink >
&>> 80520 == 22 * 3600 + 22 * 60
10:10
<
LnxBil >
oh, it's time.
10:10
eb0t has joined #ruby
10:11
<
LnxBil >
a little bit to intelligent for my use case here.
10:18
AlHafoudh has joined #ruby
10:24
cnsvc has quit [Ping timeout: 256 seconds]
10:25
conta has quit [Ping timeout: 255 seconds]
10:38
conta has joined #ruby
10:43
AlHafoudh has quit [Ping timeout: 248 seconds]
10:46
laaron- has joined #ruby
10:48
FrankDW has quit [Remote host closed the connection]
10:49
FrankDW has joined #ruby
10:49
d0liver has quit [Ping timeout: 252 seconds]
10:49
KnownSyntax has quit [Ping timeout: 252 seconds]
10:50
jhill has quit [Ping timeout: 248 seconds]
10:50
d0liver has joined #ruby
10:50
sparc has quit [Ping timeout: 248 seconds]
10:50
sparc has joined #ruby
10:51
KnownSyntax has joined #ruby
10:51
cnsvc has joined #ruby
10:51
jhill has joined #ruby
10:53
twoone has joined #ruby
10:58
jhill has quit [Max SendQ exceeded]
10:58
mostlybadfly has quit [Ping timeout: 252 seconds]
10:58
rafadc has quit [Read error: Connection reset by peer]
10:59
JayDoubleu has quit [Ping timeout: 252 seconds]
10:59
jhill has joined #ruby
10:59
mostlybadfly has joined #ruby
11:00
rafadc has joined #ruby
11:00
laaron has joined #ruby
11:00
JayDoubleu has joined #ruby
11:03
Swyper_ has joined #ruby
11:03
def_jam is now known as eblip
11:03
Swyper has quit [Ping timeout: 252 seconds]
11:08
Odalrick has joined #ruby
11:09
jenrzzz has joined #ruby
11:10
symm- has joined #ruby
11:12
truenito has joined #ruby
11:14
jenrzzz has quit [Ping timeout: 245 seconds]
11:14
AJA4350 has joined #ruby
11:20
AlHafoudh has joined #ruby
11:22
Nicmavr has quit [Ping timeout: 245 seconds]
11:22
Nicmavr has joined #ruby
11:23
symm- has quit [Ping timeout: 248 seconds]
11:24
cnsvc has quit [Ping timeout: 256 seconds]
11:25
ldnunes has joined #ruby
11:25
xco has joined #ruby
11:26
<
xco >
but the method is there
11:27
<
phaul >
no, it's in the instances. Not in the class
11:28
<
phaul >
last token on line 11 refers to class method / local variable
11:30
<
xco >
in that case i can change ‘api_key’ to a class method using def self.api_key … i guess
11:31
<
phaul >
right. but don't let the code drive your design. Consider what it actually belongs to
11:31
<
phaul >
and implement it that way
11:33
<
xco >
ok thanks :) taking another look from a different angle
11:34
AlHafoudh has quit [Ping timeout: 255 seconds]
12:02
cnsvc has joined #ruby
12:03
ebbflowgo has joined #ruby
12:06
Nicmavr has quit [Ping timeout: 245 seconds]
12:06
esrse has quit [Ping timeout: 255 seconds]
12:07
ebbflowgo has quit [Client Quit]
12:07
Nicmavr has joined #ruby
12:07
haengma has joined #ruby
12:10
Swyper_ has quit [Remote host closed the connection]
12:10
truenito has quit [Remote host closed the connection]
12:11
haengma has quit [Ping timeout: 244 seconds]
12:22
ebbflowgo has joined #ruby
12:22
ebbflowgo has left #ruby [#ruby]
12:22
conta has quit [Ping timeout: 246 seconds]
12:24
laaron has quit [Remote host closed the connection]
12:25
dar123 has joined #ruby
12:25
clemens3 has quit [Quit: WeeChat 2.1]
12:26
laaron has joined #ruby
12:34
cnsvc has quit [Ping timeout: 256 seconds]
12:37
apparition has joined #ruby
12:39
lucasb has joined #ruby
12:42
budonyc has joined #ruby
12:42
conta has joined #ruby
12:42
laaron has quit [Remote host closed the connection]
12:45
laaron has joined #ruby
12:47
symm- has joined #ruby
12:50
AlHafoudh has joined #ruby
12:51
Nicmavr has quit [Ping timeout: 245 seconds]
12:52
Nicmavr has joined #ruby
12:58
dsmythe has quit [Remote host closed the connection]
12:58
FrankDW has quit [Changing host]
12:58
FrankDW has joined #ruby
12:58
dsmythe has joined #ruby
13:03
daniel____ has joined #ruby
13:07
cnsvc has joined #ruby
13:08
kyrylo has quit [Read error: Connection reset by peer]
13:08
kyrylo has joined #ruby
13:10
jenrzzz has joined #ruby
13:13
jcalla has joined #ruby
13:13
AlHafoudh has quit [Ping timeout: 246 seconds]
13:14
jenrzzz has quit [Ping timeout: 258 seconds]
13:17
edwardly has quit [Read error: Connection reset by peer]
13:18
Odalrick has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
13:21
edwardly has joined #ruby
13:21
edwardly has quit [Changing host]
13:21
edwardly has joined #ruby
13:29
AlHafoudh has joined #ruby
13:35
pupsikov has joined #ruby
13:35
ellcs has quit [Remote host closed the connection]
13:36
Inline has joined #ruby
13:37
conta has quit [Quit: conta]
13:38
tris has quit [Ping timeout: 255 seconds]
13:41
Odalrick has joined #ruby
13:41
tris has joined #ruby
13:48
gnufied has joined #ruby
13:51
Jonopoly has joined #ruby
13:56
AlHafoudh has quit [Ping timeout: 246 seconds]
13:58
ramfjord has joined #ruby
14:00
yuriii has quit [Quit: Konversation terminated!]
14:02
budonyc has quit [Quit: Leaving]
14:03
ramfjord has quit [Ping timeout: 248 seconds]
14:04
symm- has quit [Ping timeout: 245 seconds]
14:06
cnsvc has quit [Ping timeout: 256 seconds]
14:08
agent_white has joined #ruby
14:10
csrcordeiro has joined #ruby
14:10
maryo has quit [Remote host closed the connection]
14:10
AlHafoudh has joined #ruby
14:10
maryo has joined #ruby
14:11
frem has joined #ruby
14:14
AlHafoudh has quit [Ping timeout: 248 seconds]
14:14
sh7d has quit [Ping timeout: 255 seconds]
14:15
sh7d has joined #ruby
14:15
daniel____ has quit [Ping timeout: 252 seconds]
14:17
cthulchu has joined #ruby
14:18
cthulchu_ has joined #ruby
14:22
cthulchu has quit [Ping timeout: 246 seconds]
14:23
ryouba has left #ruby ["WeeChat 1.6"]
14:34
TomyWork has quit [Remote host closed the connection]
14:37
cnsvc has joined #ruby
14:43
aupadhye has quit [Remote host closed the connection]
14:43
lubekpl has quit [Read error: Connection reset by peer]
14:47
laaron- has joined #ruby
14:48
al2o3-cr has quit [Quit: If the universe is a machine where the future is uniquely determined by its present state, it would not be possible to calculate what the future will be.]
14:50
twoone has left #ruby [#ruby]
14:51
Nicmavr has quit [Ping timeout: 245 seconds]
14:52
Nicmavr has joined #ruby
14:54
al2o3-cr has joined #ruby
14:55
agent_white has quit [Quit: brb]
15:00
jenrzzz has joined #ruby
15:02
daniel____ has joined #ruby
15:04
<
robotcars >
i'm trying compare to 2 hashes and log a row if h2 is missing some key of h1, but not if the value of the key in h1 is nil/null.
https://dpaste.de/A55X#
15:04
jenrzzz has quit [Ping timeout: 244 seconds]
15:04
<
robotcars >
im unable to exclude the 'if value is nil'
15:05
tdy has joined #ruby
15:05
<
robotcars >
i keep getting flags for missing the key, when its nil
15:05
<
havenwood >
robotcars: test is compacted keys, so nils are removed already
15:05
<
havenwood >
robotcars: you #compact on line 8
15:06
<
havenwood >
robotcars: you can remove the parens on line 8
15:06
<
robotcars >
right, so i'd expect that the value doesn't exist in either
15:07
<
havenwood >
robotcars: ah, i'm not following what the issue is
15:07
<
robotcars >
currently, it correctly logs a line if the second hash doesn't contain a key from the first hash… perfect
15:08
<
robotcars >
but it also logs a one if the value in hash 1 is nil
15:08
<
robotcars >
my first logic was to check for nil, then I tried compact
15:08
<
robotcars >
i shouldn't even be comparing keys with no value
15:08
<
havenwood >
robotcars: where are you checking for nil values in the code you linked?
15:09
cnsvc has quit [Ping timeout: 256 seconds]
15:10
<
havenwood >
gotcha, so if `md` has the key but the `em` value of the key is `nil`, you skip it
15:10
<
robotcars >
correct
15:10
<
havenwood >
or if em doesn't have that key
15:10
<
havenwood >
(which would also return `nil`)
15:11
<
robotcars >
em should always have the key
15:11
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
15:12
<
robotcars >
assuming that what i'm missing is in md
15:12
<
havenwood >
robotcars: and `md` does have the key for the `em` that's `nil`?
15:12
<
robotcars >
md may be missing the key from em, but em.key.value might be null
15:13
<
havenwood >
robotcars: To enforce the assumption that `em` has the key `k`: em.fetch(k).nil?
15:14
gregf_ has joined #ruby
15:15
<
havenwood >
robotcars: to clarify, you don't want to always skip when em's value is nil?: next if em.fetch(k).nil?
15:18
gregf_ has quit [Ping timeout: 256 seconds]
15:20
Jonopoly has quit [Ping timeout: 252 seconds]
15:22
Kestrel-029 has joined #ruby
15:22
Nicmavr has quit [Ping timeout: 245 seconds]
15:23
andikr has quit [Remote host closed the connection]
15:24
za1b1tsu has quit [Remote host closed the connection]
15:26
Nicmavr has joined #ruby
15:27
Kestrel-029 has quit [Ping timeout: 245 seconds]
15:27
<
robotcars >
so yes. if if its nill, i want to skip
15:27
<
robotcars >
added a couple lines of the log example..
15:28
<
robotcars >
i'm missing context_sis_source_id in my defined code, I'm looking to identify it and log that i'm missing it… session_id is getting caught, but it's null in this message, won't be in others. but I know it exists
15:33
laaron has joined #ruby
15:35
laaron has quit [Client Quit]
15:36
laaron has joined #ruby
15:38
cnsvc has joined #ruby
15:39
laaron has quit [Client Quit]
15:42
laaron has joined #ruby
15:45
apparition has quit [Quit: Bye]
15:46
laaron has quit [Ping timeout: 256 seconds]
15:48
agent_white has joined #ruby
15:48
r29v has joined #ruby
15:48
laaron has joined #ruby
15:51
Nicmavr has quit [Ping timeout: 245 seconds]
15:51
weteamsteve has joined #ruby
15:52
Nicmavr has joined #ruby
15:52
jobewan has joined #ruby
15:59
LtHummus has joined #ruby
16:00
mikecmpb_ has joined #ruby
16:02
laaron has quit [Remote host closed the connection]
16:02
mikecmpbll has quit [Ping timeout: 245 seconds]
16:03
r29v has quit [Quit: r29v]
16:03
mikecmpb_ has quit [Client Quit]
16:04
r29v has joined #ruby
16:04
r29v has quit [Client Quit]
16:04
Dbugger has joined #ruby
16:04
r29v has joined #ruby
16:06
stooj has joined #ruby
16:07
laaron has joined #ruby
16:07
renich has joined #ruby
16:11
cnsvc has quit [Ping timeout: 256 seconds]
16:14
rhuang_ has joined #ruby
16:15
haengma has joined #ruby
16:15
haengma has quit [Remote host closed the connection]
16:17
haengma has joined #ruby
16:31
waheedi has quit [Quit: waheedi]
16:32
SeepingN has joined #ruby
16:34
maryo_ has joined #ruby
16:36
rhuang_ has quit [Remote host closed the connection]
16:36
duderonomy has joined #ruby
16:37
nowhereman has joined #ruby
16:38
maryo has quit [Ping timeout: 255 seconds]
16:38
rhuang_ has joined #ruby
16:39
polishdub has joined #ruby
16:41
rhuang_ has quit [Remote host closed the connection]
16:43
rhuang_ has joined #ruby
16:44
nowhere_man has joined #ruby
16:44
nowhereman has quit [Ping timeout: 252 seconds]
16:46
fphilipe_ has quit [Ping timeout: 245 seconds]
16:48
cnsvc has joined #ruby
16:48
jefffrails35 has quit [Remote host closed the connection]
16:51
Nicmavr has quit [Ping timeout: 245 seconds]
16:52
Nicmavr has joined #ruby
17:00
<
havenwood >
robotcars: can you show us an example `event_data` and `metadata` and what the desired result would be with those inputs?
17:01
fphilipe_ has joined #ruby
17:01
<
havenwood >
robotcars: #select is perfect for when you want to create a new collection that only includes iterations that have a truthy return value
17:02
<
havenwood >
robotcars: I'd suggest using longer variable names. When you have a singular and plural of the same variable, use the singular and plural form of the same word!
17:03
<
havenwood >
like on line 11, `test.each do |k|` is easier to follow as `keys.each do |key|`
17:03
<
havenwood >
robotcars: keys.select do |k|
17:03
<
havenwood >
robotcars: keys.select do |key|
17:04
daniel____ has quit [Ping timeout: 258 seconds]
17:04
<
havenwood >
robotcars: then you can drop the `missing << k`
17:04
<
havenwood >
if you `next` it won't be part of the return collection
17:04
<
robotcars >
with select can I do regex matching?
17:05
<
havenwood >
you can do whatever in the block with select, it'll just only include those that have a truthy return value for the iteration
17:05
<
robotcars >
need to compare the key name with key or key?_meta
17:05
<
robotcars >
excellent
17:06
fphilipe_ has quit [Ping timeout: 258 seconds]
17:07
Kestrel-029 has joined #ruby
17:07
<
havenwood >
&>> ['can', 'I', 'do', 'regex', 'matching'].select { |word| next if word.include?('c'); word.match?(/[aeiou]/) }
17:07
Nicmavr has quit [Ping timeout: 245 seconds]
17:08
<
havenwood >
robotcars: #grep is a shorthand, if you
_just_ want to check a Regexp or something else that responds to #===
17:08
<
havenwood >
&>> ['can', 'I', 'do', 'regex', 'matching'].grep(/[aeiou]/)
17:08
<
havenwood >
robotcars: #select, #reject and #map are particularly handy
17:08
pupsikov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
17:09
lxsameer has quit [Ping timeout: 268 seconds]
17:09
<
havenwood >
$>> ['can', 'I', 'do', 'regex', 'matching'].all? /[aeiou]/
17:10
<
havenwood >
#=> false
17:10
<
robotcars >
ty. really appreciate tips!
17:10
waheedi has joined #ruby
17:15
daniel____ has joined #ruby
17:18
renich has quit [Ping timeout: 258 seconds]
17:20
daniel____ has quit [Ping timeout: 248 seconds]
17:28
wilbert has joined #ruby
17:29
<
robotcars >
havenwood: ty
17:30
daniel____ has joined #ruby
17:31
ellcs has joined #ruby
17:36
AJA4350 has quit [Ping timeout: 268 seconds]
17:37
AJA4350 has joined #ruby
17:41
<
havenwood >
robotcars: it's a bit nicer to use `value.nil?` instead of `value == nil`
17:41
<
havenwood >
robotcars: instead of `missing.count >= 1`, consider `missing.size.positive?`
17:41
psyton has joined #ruby
17:42
<
havenwood >
(#size often means lazy count and #count often means iterating to count, so I prefer #size for simple cases)
17:42
<
havenwood >
lazy count as in the collection knows its size, so it doesn't have to actually count
17:43
<
havenwood >
this particularly matters if the collection is infinite, since you'll be counting forever but can have a #size return: Infinity
17:44
s00pcan has quit [Ping timeout: 246 seconds]
17:44
psyton has quit [Client Quit]
17:45
psyton has joined #ruby
17:46
s00pcan has joined #ruby
17:46
<
havenwood >
robotcars: you can symbolize keys as you parse JSON: JSON.parse(json, symbolize_names: true)
17:49
weteamsteve has quit [Ping timeout: 252 seconds]
17:50
schne1der has joined #ruby
17:51
nowhere_man has quit [Ping timeout: 248 seconds]
17:51
jenrzzz has joined #ruby
17:53
xco has left #ruby [#ruby]
17:57
reber has joined #ruby
17:57
s00pcan has quit [Quit: Reconnecting]
17:58
s00pcan has joined #ruby
18:00
pupsikov has joined #ruby
18:02
ellcs has quit [Ping timeout: 252 seconds]
18:03
csrcordeiro has quit [Quit: Leaving]
18:10
ldnunes has quit [Quit: Leaving]
18:10
Kestrel-029 has quit [Ping timeout: 245 seconds]
18:11
Nicmavr has joined #ruby
18:18
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
18:20
ramfjord has joined #ruby
18:28
mikecmpbll has joined #ruby
18:28
sauvin has quit [Read error: Connection reset by peer]
18:33
hightower2 has joined #ruby
18:34
ramfjord has quit [Ping timeout: 255 seconds]
18:35
hightower2 has quit [Remote host closed the connection]
18:36
jenrzzz has quit [Quit: Lost terminal]
18:36
hightower2 has joined #ruby
18:36
hightower2 has quit [Max SendQ exceeded]
18:37
ramfjord has joined #ruby
18:37
hightower2 has joined #ruby
18:38
nowhere_man has joined #ruby
18:38
hightower2 has quit [Changing host]
18:38
hightower2 has joined #ruby
18:41
daniel____ has quit [Remote host closed the connection]
18:51
jobewan has quit [Quit: jobewan]
18:53
r29v has quit [Ping timeout: 246 seconds]
18:59
Iarfen has joined #ruby
19:05
ramfjord has quit [Ping timeout: 245 seconds]
19:11
sameerynho has joined #ruby
19:12
code_zombie has joined #ruby
19:12
jmcgnh has joined #ruby
19:14
taylorrf has joined #ruby
19:15
tdy has quit [Ping timeout: 248 seconds]
19:16
symm- has joined #ruby
19:18
rem_ has joined #ruby
19:19
jmcgnh has quit [Ping timeout: 248 seconds]
19:21
taylorrf has quit []
19:23
dinfuehr has quit [Ping timeout: 248 seconds]
19:25
gigetoo has quit [Ping timeout: 245 seconds]
19:25
yokel has quit [Ping timeout: 244 seconds]
19:26
ujjain- has quit [Remote host closed the connection]
19:28
yokel has joined #ruby
19:29
ramfjord has joined #ruby
19:31
Jonopoly has joined #ruby
19:34
jrafanie has joined #ruby
19:35
zapata has quit [Quit: WeeChat 2.4]
19:36
Jonopoly has quit [Quit: WeeChat 2.4]
19:36
gigetoo has joined #ruby
19:42
tdy has joined #ruby
19:42
kapilp has quit [Quit: Connection closed for inactivity]
19:47
swarley has joined #ruby
19:48
swarley is now known as swarles
19:58
kyrylo has joined #ruby
19:58
tdy has quit [Ping timeout: 252 seconds]
20:05
Iarfen has quit [Remote host closed the connection]
20:15
orbyt_ has joined #ruby
20:15
cnsvc has quit [Ping timeout: 256 seconds]
20:19
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
20:20
Azure|dc is now known as Azure
20:21
Jonopoly has joined #ruby
20:22
tdy has joined #ruby
20:24
dellavg_ has quit [Ping timeout: 245 seconds]
20:25
govg has joined #ruby
20:25
gix has joined #ruby
20:27
hightower2 has quit [Remote host closed the connection]
20:30
cd has joined #ruby
20:33
Freshnuts has joined #ruby
20:38
dsmythe_ has joined #ruby
20:41
dsmythe_ has quit [Remote host closed the connection]
20:41
nowhereman has joined #ruby
20:41
nowhere_man has quit [Ping timeout: 245 seconds]
20:41
frem has quit [Quit: Connection closed for inactivity]
20:41
dsmythe_ has joined #ruby
20:42
fphilipe_ has joined #ruby
20:42
dsmythe has quit [Ping timeout: 252 seconds]
20:47
fphilipe_ has quit [Ping timeout: 252 seconds]
20:52
hightower2 has joined #ruby
20:52
gigetoo has quit [Read error: Connection reset by peer]
20:52
gigetoo has joined #ruby
21:02
za1b1tsu has joined #ruby
21:02
jmcgnh has joined #ruby
21:04
cnsvc has joined #ruby
21:08
AlHafoudh has joined #ruby
21:08
fphilipe_ has joined #ruby
21:09
waheedi has quit [Quit: waheedi]
21:10
djellemah has joined #ruby
21:10
jmcgnh has quit [Ping timeout: 244 seconds]
21:10
waheedi has joined #ruby
21:14
kapilp has joined #ruby
21:15
cnsvc has quit [Ping timeout: 256 seconds]
21:16
dsmythe_ has quit [Remote host closed the connection]
21:16
dsmythe has joined #ruby
21:17
<
robotcars >
havenwood: couldn't quite get effective with select, this ok?
https://dpaste.de/ctJs# - i'll have to JSON.parse(json, symbolize_names: true) in a different commit after eval.
21:20
reber has quit [Remote host closed the connection]
21:21
Nicmavr has quit [Ping timeout: 245 seconds]
21:22
ua has quit [Ping timeout: 245 seconds]
21:22
Nicmavr has joined #ruby
21:26
Kestrel-029 has joined #ruby
21:27
Nicmavr has quit [Ping timeout: 245 seconds]
21:27
jenrzzz has joined #ruby
21:27
fphilipe_ has quit [Ping timeout: 258 seconds]
21:27
ua has joined #ruby
21:35
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
21:36
AJA4350 has quit [Remote host closed the connection]
21:37
AJA4350 has joined #ruby
21:38
tdy has quit [Ping timeout: 268 seconds]
21:40
wilbert has quit [Ping timeout: 246 seconds]
21:42
jenrzzz has quit [Ping timeout: 245 seconds]
21:44
Ai9zO5AP has quit [Quit: WeeChat 2.4]
21:44
jenrzzz has joined #ruby
21:49
jenrzzz has quit [Ping timeout: 268 seconds]
21:50
Dbugger has quit [Quit: Leaving]
21:50
cnsvc has joined #ruby
21:52
fphilipe_ has joined #ruby
21:55
za1b1tsu has quit [Remote host closed the connection]
21:55
cnsvc has quit [Remote host closed the connection]
21:57
jenrzzz has joined #ruby
22:01
cnsvc has joined #ruby
22:03
zapata has joined #ruby
22:04
rem_ has quit [Remote host closed the connection]
22:07
jenrzzz has quit [Ping timeout: 255 seconds]
22:10
ramfjord has quit [Ping timeout: 246 seconds]
22:10
cthulchu_ has quit [Ping timeout: 246 seconds]
22:12
schne1der has quit [Quit: WeeChat 1.9.1]
22:19
djellemah has quit [Ping timeout: 248 seconds]
22:20
swarles is now known as swarley
22:24
jenrzzz has joined #ruby
22:26
fphilipe_ has quit [Ping timeout: 248 seconds]
22:26
hightower3 has joined #ruby
22:29
swarley has quit [Ping timeout: 276 seconds]
22:29
hightower2 has quit [Ping timeout: 245 seconds]
22:29
jenrzzz has quit [Ping timeout: 246 seconds]
22:30
jenrzzz has joined #ruby
22:32
robotcars has quit [Quit: Leaving.]
22:32
Jonopoly has quit [Quit: WeeChat 2.4]
22:34
AlHafoudh has quit [Ping timeout: 258 seconds]
22:38
jenrzzz has quit [Ping timeout: 248 seconds]
22:42
AJA4350 has quit [Remote host closed the connection]
22:43
AJA4350 has joined #ruby
22:43
polishdub has quit [Quit: leaving]
22:44
sameerynho has quit [Ping timeout: 244 seconds]
22:45
nowhereman has quit [Ping timeout: 248 seconds]
22:48
Swyper has joined #ruby
22:52
renich has joined #ruby
22:53
Swyper has quit [Remote host closed the connection]
22:58
Swyper has joined #ruby
23:01
jenrzzz has joined #ruby
23:02
orbyt_ has joined #ruby
23:02
Swyper has quit [Ping timeout: 246 seconds]
23:06
_whitelogger has joined #ruby
23:07
Swyper has joined #ruby
23:08
AlHafoudh has joined #ruby
23:08
swarley has joined #ruby
23:09
pupsikov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
23:09
Swyper has quit [Read error: Connection reset by peer]
23:10
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
23:11
Swyper has joined #ruby
23:13
Swyper_ has joined #ruby
23:13
Swyper has quit [Read error: Connection reset by peer]
23:14
pupsikov has joined #ruby
23:15
Swyper_ has quit [Read error: Connection reset by peer]
23:15
Swyper has joined #ruby
23:15
<
havenwood >
missed robotocars, but much better!!
23:17
Swyper has quit [Read error: Connection reset by peer]
23:17
Swyper has joined #ruby
23:19
symm- has quit [Ping timeout: 248 seconds]
23:22
Swyper has quit [Ping timeout: 255 seconds]
23:23
fphilipe_ has joined #ruby
23:24
rhuang_ has quit [Ping timeout: 255 seconds]
23:25
AlHafoudh has quit [Ping timeout: 255 seconds]
23:29
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
23:29
rhuang_ has joined #ruby
23:32
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
23:32
eblip has quit [Quit: WeeChat 2.3]
23:33
rhuang_ has quit [Remote host closed the connection]
23:33
kyrylo has joined #ruby
23:45
i1nfusion has joined #ruby
23:51
waheedi has quit [Quit: waheedi]
23:52
al-damiri has joined #ruby
23:54
cnsvc has quit [Ping timeout: 256 seconds]
23:54
cold_iron has joined #ruby
23:56
fphilipe_ has quit [Ping timeout: 248 seconds]
23:57
cnsvc has joined #ruby
23:59
djellemah has joined #ruby