Azure has quit [Read error: Connection reset by peer]
<baweaver>
IbrahimA: #RubyOnRails might be a better place to ask.
nankyokusei has quit [Ping timeout: 244 seconds]
Azure has joined #ruby
<jhass>
map.uniq ?
jenrzzz has quit [Ping timeout: 258 seconds]
kobain has joined #ruby
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
AustinMatherne has quit [Remote host closed the connection]
Guest38_ has quit [Read error: Connection reset by peer]
Tempesta has joined #ruby
ruid has joined #ruby
Tempesta has left #ruby [#ruby]
<IbrahimA>
hmm, the pattern isn't really rails specific i would think
<baweaver>
(If it were a rails collection, the answer would be very different.)
blackmesa has quit [Ping timeout: 276 seconds]
<IbrahimA>
do you mean an activerecord relation? how so?
<baweaver>
then it'd likely be some variant of DISTINCT or GROUP
<IbrahimA>
well im not actually grouping because there should only be one element per group
<baweaver>
but again, this is far more of a topic for #RubyOnRails.
<matthewd>
ActiveSupport has Enumerable#index_by
<baweaver>
Loading all the resources into memory would be very inefficient if you need something like counts or unique names.
<baweaver>
Model.group(:attribute).count would make something like {a: 15, b: 10, c: 5}
<IbrahimA>
im not counting, i need every instance
<matthewd>
But there are much better options if it's an ActiveRecord relation... which are not on topic here.
<IbrahimA>
matthewd: thanks! that's what im looking for
<matthewd>
It might be what you're looking for, but I'm not so convinced it's the right tool for the job
<IbrahimA>
perhaps not
Torrone has quit [Quit: This computer has gone to sleep]
<IbrahimA>
are you saying i should be using includes to include all needed assocations?
<matthewd>
I'm saying you should join #rubyonrails
jhack has joined #ruby
<IbrahimA>
hm ok, well thanks! maybe another time i'll try to figure out why this pattern occurs in our codebase and whether there's a better way but i have more important things to worry about right now. was just curious
AnFin has joined #ruby
IbrahimA has left #ruby [#ruby]
cdg has quit [Remote host closed the connection]
AnFin has left #ruby [#ruby]
AnFin has joined #ruby
AnFin has left #ruby ["linux"]
AnFin has joined #ruby
memorasus has quit [Read error: Connection reset by peer]
rkazak has joined #ruby
nettoweb has joined #ruby
JeanCarloMachado has joined #ruby
JeanCarloMachado has quit [Remote host closed the connection]
PickAndMix has quit [Quit: WeeChat 1.4]
hahuang61 has joined #ruby
djbkd has quit [Quit: My people need me...]
Rodya_ has joined #ruby
rcvalle has quit [Quit: rcvalle]
davidw has quit [Ping timeout: 265 seconds]
spectrum has quit [Ping timeout: 252 seconds]
JeanCarloMachado has joined #ruby
nitric has quit [Ping timeout: 244 seconds]
JeanCarloMachado has quit [Remote host closed the connection]
hahuang61 has quit [Ping timeout: 250 seconds]
blackgoat has quit [Ping timeout: 244 seconds]
JeanCarloMachado has joined #ruby
rgiscard has quit [Ping timeout: 276 seconds]
JeanCarloMachado has quit [Remote host closed the connection]
skweek has quit [Ping timeout: 240 seconds]
theta8 has quit [Quit: leaving]
dsea has quit [Ping timeout: 258 seconds]
karapetyan has joined #ruby
the_rhizo2 has quit [Ping timeout: 252 seconds]
replay has quit []
<ICantCook>
I'm trying to cat a file into ruby from the shell (cat file.txt |ruby -e '') and use "gets" to read the file
<ICantCook>
but only the first line is being read
<ICantCook>
by gets
JeanCarloMachado has joined #ruby
<ICantCook>
how can I read through the entire file?
the_rhizo2 has joined #ruby
<AnFin>
ruby file.txt?
karapetyan has quit [Ping timeout: 244 seconds]
<ICantCook>
AnFin: no, I'm going to do some regex, etc on the file first, then "puts" out some output to use in the shell
jgt2 has quit [Ping timeout: 244 seconds]
marr has quit [Remote host closed the connection]
workmad3 has joined #ruby
<AnFin>
'ruby -e' works with one string, isn't it?
roflmyeggo has joined #ruby
<AnFin>
always, as fact
blackgoat has joined #ruby
<xaviergmail>
Right so I see .to_s being used a lot, is that a function or a member that executes code when accessed?
<jhass>
ICantCook use $stdin.read
<xaviergmail>
I guess what I'm asking is: if I access an object's field that is a function, does the function get automatically called even without parenthesis or do I get the function object itself
<ICantCook>
jhass: that gives me an array :(
AnFin is now known as Guest7628
workmad3 has quit [Ping timeout: 244 seconds]
<jhass>
read doesn't, readlines would
the_rhizo2 has quit [Ping timeout: 258 seconds]
leitz has quit [Quit: Nappy time]
astrobun_ has quit [Remote host closed the connection]
der-landgraf has quit [Ping timeout: 258 seconds]
ramfjord_ has joined #ruby
Guest7628 has quit [Ping timeout: 265 seconds]
<jhass>
xaviergmail it's a method call, no property access or first class methods in Ruby
LoneHerm_ has joined #ruby
AnFin__ has joined #ruby
<xaviergmail>
Aw :( I love first class functions
LoneHerm_ has quit [Remote host closed the connection]
<xaviergmail>
I'll live without them though, thanks for helping out!
LoneHerm_ has joined #ruby
<jhass>
Blocks and procs fill their usecase
der-landgraf has joined #ruby
GinoMan2440 has quit [Ping timeout: 250 seconds]
ramfjord has quit [Ping timeout: 244 seconds]
stamina has quit [Ping timeout: 250 seconds]
aryaching has quit [Ping timeout: 244 seconds]
<xaviergmail>
Gotcha
<jhass>
I also would say no functions in Ruby, only methods, though some people consider procs to be functions
GinoMan2440 has joined #ruby
dminuoso has joined #ruby
LoneHerm_ has quit [Remote host closed the connection]
jenrzzz has joined #ruby
<xaviergmail>
Hmm?
tvw has quit [Ping timeout: 260 seconds]
aryaching has joined #ruby
A_Drone has joined #ruby
dminuoso has quit [Ping timeout: 258 seconds]
evilNerd is now known as rails
daffy_duck_2 has quit [Ping timeout: 265 seconds]
<xaviergmail>
Isn't `def f(x) return x*2 end` a function, seeing as it doesn't operate on an.. but x is an object, this just got marginally more confusing
johnny56_ has quit [Ping timeout: 264 seconds]
Spami has quit [Quit: This computer has gone to sleep]
<xaviergmail>
I'll hold onto that thought for a while
hutch34 has joined #ruby
johnny56_ has joined #ruby
Rodya_ has quit [Remote host closed the connection]
nando293921 has quit [Ping timeout: 244 seconds]
harfangk has joined #ruby
swills has joined #ruby
der-landgraf has quit [Ping timeout: 250 seconds]
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
blackmesa has joined #ruby
Balzrael has quit [Quit: Leaving]
AnFin__ has left #ruby [#ruby]
hutch34 has quit [Ping timeout: 258 seconds]
<matthewd>
xaviergmail: It's still a method, which you call on a particular object; the fact you're not accessing the object doesn't change that
<ICantCook>
jhass: thanks :)
der-landgraf has joined #ruby
<xaviergmail>
matthewd: Yeah that's what I began to think as I wrote that out
yeticry has quit [Ping timeout: 244 seconds]
daffy_duck_2 has joined #ruby
yeticry has joined #ruby
<matthewd>
Ah, okay. I just wanted to clarify that x isn't the object in question
<xaviergmail>
Wait that wasn't clarified x_x
<xaviergmail>
Where does this 'particular object' come from
<matthewd>
There is a 'self' inside that method, which refers the object the method was called on
nando293921 has joined #ruby
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
blackmesa has quit [Ping timeout: 244 seconds]
<jhass>
Toplevel methods are defined as private on Object and called on main, an instance of Object and the self of the toplevel
Dysp has quit [Ping timeout: 250 seconds]
<xaviergmail>
if I just do print f(5) in a script's body, what is self? The current scope..?
<jhass>
See above :)
<xaviergmail>
ag
<xaviergmail>
ah*
c355e3b has quit [Quit: Connection closed for inactivity]
<xaviergmail>
Interesting concept
AustinMatherne has joined #ruby
sneakerhax has joined #ruby
aryaching has quit [Read error: Connection reset by peer]
aryaching has joined #ruby
Ropeney has joined #ruby
JeanCarloMachado has quit [Ping timeout: 258 seconds]
ramfjord_ has quit [Ping timeout: 258 seconds]
SilverKey has joined #ruby
etehtsea has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Azure has quit [Read error: Connection reset by peer]
hahuang61 has joined #ruby
Azure has joined #ruby
Azure has quit [Read error: Connection reset by peer]
spudowiar has quit [Quit: Leaving.]
David27 has quit [Quit: Going offline, see ya! (www.adiirc.com)]
Azure has joined #ruby
Azure has quit [Read error: Connection reset by peer]
ebbflowgo has quit [Quit: ebbflowgo]
Azure has joined #ruby
hahuang61 has quit [Ping timeout: 258 seconds]
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
douglasc_ has joined #ruby
spudowiar has joined #ruby
johnny56 has joined #ruby
azor has quit [Quit: Connection closed for inactivity]
johnny56_ has quit [Ping timeout: 264 seconds]
ebbflowgo has joined #ruby
the_rhizo2 has joined #ruby
douglasc_ has quit []
dionysus69 has joined #ruby
rkazak has quit [Quit: Sleep.....ing....]
Azure has quit [Read error: Connection reset by peer]
arescorpio has joined #ruby
the_rhizo2 has quit [Ping timeout: 250 seconds]
Azure has joined #ruby
ruid has quit [Ping timeout: 240 seconds]
bad_ip has joined #ruby
rkazak has joined #ruby
nickjj_ has joined #ruby
zel has joined #ruby
zel is now known as Guest11585
meinside has quit [Quit: Connection closed for inactivity]
nickjj has quit [Ping timeout: 244 seconds]
etehtsea has quit [Quit: Computer has gone to sleep.]
Azure has quit [Read error: Connection reset by peer]
dminuoso has joined #ruby
Azure has joined #ruby
LoneHerm_ has joined #ruby
nankyokusei has joined #ruby
P_R_Deltoid has joined #ruby
swills has quit [Quit: Leaving]
the_rhizo2 has joined #ruby
<P_R_Deltoid>
Is there anything funky about returning Proc objects from functions as opposed to creating them inline before they are used?
SilverKey has quit [Ping timeout: 260 seconds]
astrobun_ has joined #ruby
truelai has quit [Remote host closed the connection]
dminuoso has quit [Ping timeout: 276 seconds]
nankyokusei has quit [Ping timeout: 260 seconds]
Rodya_ has joined #ruby
Velizar has quit [Quit: Velizar]
<P_R_Deltoid>
Nevermind, I am an idiot and didn't realize I was using a local variable which wasn't available
astrobun_ has quit [Remote host closed the connection]
SilverKey has joined #ruby
hutch34 has joined #ruby
pokalyis has quit [Read error: Connection reset by peer]
Rodya_ has quit [Ping timeout: 250 seconds]
postmodern has quit [Quit: Leaving]
yeticry_ has quit [Ping timeout: 250 seconds]
JUgelen has joined #ruby
skweek has joined #ruby
blackmesa has joined #ruby
dionysus69 has quit [Quit: dionysus69]
A_Drone has quit [Remote host closed the connection]
yeticry_ has joined #ruby
JUgelen has quit [Read error: Connection reset by peer]
swills has joined #ruby
Azure has quit [Read error: Connection reset by peer]
xlegoman has joined #ruby
Azure has joined #ruby
JUgelen has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
enodata has joined #ruby
dionysus69 has joined #ruby
Azure has quit [Read error: Connection reset by peer]
Azure has quit [Read error: Connection reset by peer]
hahuang61 has quit [Ping timeout: 260 seconds]
Azure has joined #ruby
jzigmund has quit [Ping timeout: 250 seconds]
nettoweb has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Azure has quit [Read error: Connection reset by peer]
tmtwd has joined #ruby
govg has quit [Ping timeout: 258 seconds]
Azure has joined #ruby
Titre12 has quit [Read error: Connection reset by peer]
bad_ip has quit [Ping timeout: 265 seconds]
ebbflowgo has quit [Quit: ebbflowgo]
thebrianguy has joined #ruby
ebbflowgo has joined #ruby
leea has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ericsupreme has joined #ruby
Azure has quit [Read error: Connection reset by peer]
ebbflowgo has quit [Client Quit]
thebrianguy has left #ruby ["Leaving"]
Azure has joined #ruby
LoneHerm_ has quit [Ping timeout: 252 seconds]
thebrianguy has joined #ruby
dminuoso has joined #ruby
etehtsea has joined #ruby
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
rgiscard has joined #ruby
GodFather has quit [Ping timeout: 265 seconds]
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
jishankai has joined #ruby
gnufied has joined #ruby
karapetyan has joined #ruby
dminuoso has quit [Ping timeout: 244 seconds]
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
titre1 has joined #ruby
karapetyan has quit [Ping timeout: 264 seconds]
ericsupreme has quit [Quit: Leaving]
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
rgiscard has quit [Ping timeout: 264 seconds]
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
rgiscard has joined #ruby
blackmesa has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
rgiscard has quit [Client Quit]
rgiscard has joined #ruby
A_Drone has quit [Remote host closed the connection]
Rodya_ has joined #ruby
A_Drone has joined #ruby
<thebrianguy>
topic
<titre1>
hi
<titre1>
bay
titre1 has quit [Quit: Saliendo]
blackmesa has quit [Ping timeout: 276 seconds]
Rodya_ has quit [Remote host closed the connection]
Azure has quit [Read error: Connection reset by peer]
Rodya_ has joined #ruby
Azure has joined #ruby
karapetyan has joined #ruby
<thebrianguy>
I am doing an exercise from Learn to Program where I am to take an array of names or words and shuffle the order. I want to be able to pass a parameter to dictate how many times the loop will run to shuffle the names or words. However I am seeing something I don't understand. The variable is for a while loop. However I noticed that once it hits zero it continues and even appears to create random numbers. https://gist.github.com/Th
<atmosx>
hi, File.readlines('foo.txt') will read the lines and close the file right? So if I do => unless File.readlines("foo").grep(/#{string}/).any?; File.open('foo', 'a') { |f| f << "#{string}"}; end ... I don't risk file corruption right?
paradisaeidae has quit [Remote host closed the connection]
stuartrexking has quit [Ping timeout: 240 seconds]
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Ropeney has quit [Ping timeout: 244 seconds]
andikr has joined #ruby
zacts has joined #ruby
zacts has quit [Client Quit]
zacts has joined #ruby
nbdy has quit [Ping timeout: 276 seconds]
blackmesa has joined #ruby
fnux has joined #ruby
iMadper` has joined #ruby
Guest38498 is now known as saneax_AFK
iMadper has quit [Ping timeout: 240 seconds]
A_Drone has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
ta_ has joined #ruby
ta_ has quit [Remote host closed the connection]
ta_ has joined #ruby
blackmesa has quit [Ping timeout: 264 seconds]
ddffg has joined #ruby
hahuang61 has joined #ruby
astrobun_ has joined #ruby
Silthias1 has joined #ruby
astrobun_ has quit [Remote host closed the connection]
eprasad has quit [Ping timeout: 260 seconds]
Silthias has quit [Ping timeout: 260 seconds]
astrobun_ has joined #ruby
hahuang61 has quit [Ping timeout: 260 seconds]
dionysus69 has quit [Remote host closed the connection]
Nahra has joined #ruby
devec0 has joined #ruby
dionysus69 has joined #ruby
macsteps has joined #ruby
stan has quit [Quit: Leaving]
Silex has quit [Quit: WeeChat 1.4]
antgel has joined #ruby
macsteps has quit [Ping timeout: 258 seconds]
dionysus69 has quit [Remote host closed the connection]
<canton7>
if it's cmd, please pastebin a transcription of exactly what you typed, and exactly what the output was, when trying to set and then read an env var
<soLucien>
hi guys ! Is there some function in ruby that can "grep" a multi-dimensional unknown length hash for a string (which can be contained in either a key or a value)
<soLucien>
i have used awesome_print to display these arrays, but is there something that can search through them?
<soLucien>
it's not very useful if the hash has 200 keys, and each of these values are unknown-length hashes
s2013 has joined #ruby
<soLucien>
of course i can write the result of awesome_print to a file and then use ctrl-f to search , but isn't there something in ruby that could do this ?
<soLucien>
*cricketsw*
TomyLobo has joined #ruby
<jhass>
.scan?
<jhass>
on the .to_s
mim1k has joined #ruby
smathy has joined #ruby
<zacts>
hi rubyists
hahuang61 has joined #ruby
synthroid has joined #ruby
karapetyan has joined #ruby
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blaxter has joined #ruby
alfiemax has joined #ruby
Bsoom_23 has quit [Remote host closed the connection]
Neobenedict has quit [Ping timeout: 244 seconds]
Neobenedict has joined #ruby
Neobenedict has quit [Changing host]
Neobenedict has joined #ruby
smathy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hahuang61 has quit [Ping timeout: 250 seconds]
GodFather has quit [Ping timeout: 258 seconds]
der-landgraf has quit [Ping timeout: 276 seconds]
poguez_ has joined #ruby
govg has joined #ruby
aryaching has joined #ruby
GodFather has joined #ruby
karapetyan has quit [Remote host closed the connection]
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
tyang has quit [Ping timeout: 260 seconds]
alfiemax has quit [Ping timeout: 276 seconds]
omphe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
luong has quit [Read error: Connection reset by peer]
yardenbar has joined #ruby
aegis3121 has quit [Ping timeout: 276 seconds]
jenrzzz has joined #ruby
flashpoint9 has quit [Ping timeout: 250 seconds]
The_Phoenix has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
rodfersou is now known as rodfersou|lunch
dunpeal has quit [Ping timeout: 276 seconds]
kedare has quit [Quit: Leaving]
The_Phoenix has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
jenrzzz has quit [Ping timeout: 244 seconds]
yardenbar has quit [Ping timeout: 244 seconds]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
The_Phoenix has joined #ruby
pokalyis has joined #ruby
Nahra` has quit [Remote host closed the connection]
The_Phoenix has quit [Max SendQ exceeded]
The_Phoenix has joined #ruby
mrgrieves has quit [Ping timeout: 250 seconds]
nankyokusei has joined #ruby
Rickmasta has joined #ruby
Nahra has joined #ruby
rileyy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
alfiemax has joined #ruby
dminuoso has joined #ruby
nankyokusei has quit [Ping timeout: 240 seconds]
eatingthenight has quit [Quit: Lost terminal]
phantummm has joined #ruby
amclain has joined #ruby
cyphase has quit [Ping timeout: 244 seconds]
edwinvdgraaf has quit []
glcx_ has quit [Quit: Quitte]
GodFather has quit [Ping timeout: 258 seconds]
kavanagh has quit [Ping timeout: 276 seconds]
dminuoso has quit [Ping timeout: 250 seconds]
eljimmy has quit [Quit: This computer has gone to sleep]
weaksauce has joined #ruby
kavanagh has joined #ruby
cyphase has joined #ruby
dionysus69 has joined #ruby
Es0teric has joined #ruby
craigp_ has quit [Ping timeout: 264 seconds]
r_rios has quit [Ping timeout: 276 seconds]
uri has quit [Quit: --]
ferr has quit [Quit: WeeChat 1.5]
A_Drone has joined #ruby
govg has quit [Ping timeout: 252 seconds]
karapetyan has joined #ruby
govg has joined #ruby
toastercup has joined #ruby
jenrzzz has joined #ruby
<toastercup>
Hey folks! I was wondering if there was better terminology for the class methods that are accessed outside of the scope of a method, and are invoked at the Class-level. i.e. in an ActiveModel, right after the class definition, you might see a 'has_many' invocation.
phantummm has quit [Quit: WeeChat 1.5]
karapetyan has quit [Remote host closed the connection]
<toastercup>
is there anything more precise I can refer to this style of invocation than just 'it's a class method'?
A_Drone has quit [Ping timeout: 244 seconds]
jgt2 has quit [Ping timeout: 276 seconds]
<jhass>
technically it's a classes singleton method but I guess that doesn't help
<jhass>
class method is pretty good as a colloquial term IMO
helpplease has joined #ruby
karapetyan has joined #ruby
<helpplease>
can anyone explain to me why this is happening?
<helpplease>
/var/lib/gems/2.3.0/gems/bundler-1.12.5/exe/bundler -v ⏎ master Bundler version 1.11.2
Snowy has quit [Remote host closed the connection]
AndrewIsHere has quit [Remote host closed the connection]
AndrewIs_ has joined #ruby
smathy has joined #ruby
AzureStigma is now known as AzureStigma|Away
whathappens has quit [Remote host closed the connection]
<jhass>
mh
AzureStigma|Away is now known as AzureStigma
<jhass>
can you gist your gem env output please? also gem list bundler and gem which bundler
whathappens has joined #ruby
cyphase has quit [Ping timeout: 260 seconds]
antgel has quit [Ping timeout: 250 seconds]
mikecmpbll has quit [Ping timeout: 276 seconds]
eljimmy has joined #ruby
symm- has joined #ruby
karapetyan has joined #ruby
dunpeal has joined #ruby
kavanagh has quit [Ping timeout: 240 seconds]
whathappens has quit [Ping timeout: 250 seconds]
govg has quit [Ping timeout: 260 seconds]
flashpoint9 has joined #ruby
<jhass>
helpplease: looks like some mess Debian made. The packaged version seems to take precedence in requires. I would recommend to remove the apt package
cyphase has joined #ruby
govg has joined #ruby
<helpplease>
jhass, ahh yeah dang apt version. removed and trying now
The_Phoenix has quit [Read error: Connection reset by peer]
flashpoint9 has quit [Ping timeout: 244 seconds]
blaxter has quit [Quit: foo]
VictoriaGo has left #ruby [#ruby]
tyang has joined #ruby
flashpoint9 has joined #ruby
skade has joined #ruby
karapetyan has quit [Remote host closed the connection]
tomphp_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tomphp has joined #ruby
smathy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
elaptics has joined #ruby
skade has quit [Ping timeout: 276 seconds]
<helpplease>
jhass: TY! I removed ruby and associated apt packages and reinstalled from source. Got what I was trying to do working now. You got a btc address I can send a tip to?
Rickmasta has joined #ruby
<jhass>
not necessary, thanks
karapetyan has joined #ruby
pmyjavec has joined #ruby
Guest4184_______ has quit [Ping timeout: 244 seconds]
<helpplease>
jhass: well thank you very much. Ive been at this since yesterday. I can get back to work now, job will be happy :)
cdg has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
Guest4184_______ has joined #ruby
rgiscard has joined #ruby
aryaching has quit [Read error: Connection reset by peer]
phantummm has joined #ruby
macsteps has joined #ruby
conta has quit [Ping timeout: 244 seconds]
skade has joined #ruby
aryaching has joined #ruby
qguv has quit [Ping timeout: 250 seconds]
mikecmpbll has joined #ruby
anisha has joined #ruby
toastercup has quit [Quit: leaving]
quiller has joined #ruby
daemonwrangler has quit [Ping timeout: 240 seconds]
govg has quit [Ping timeout: 258 seconds]
daemonwrangler has joined #ruby
zacts has quit [Ping timeout: 258 seconds]
karapetyan has quit [Remote host closed the connection]
govg has joined #ruby
karapetyan has joined #ruby
rgiscard has quit [Ping timeout: 250 seconds]
rgiscard has joined #ruby
skade has quit [Ping timeout: 244 seconds]
jrafanie_ has joined #ruby
whathappens has joined #ruby
chipotle has quit [Quit: cheerio]
kjellpropell has joined #ruby
Ishido has joined #ruby
jrafanie has quit [Ping timeout: 258 seconds]
skade has joined #ruby
aryaching has quit [Ping timeout: 276 seconds]
helpplease has quit [Ping timeout: 250 seconds]
chipotle has joined #ruby
dr0lan has quit [Quit: WeeChat 1.0.1]
[Butch] has joined #ruby
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nitric has joined #ruby
tomphp has joined #ruby
ItSANgo has quit [Quit: Leaving...]
deniskozlov has joined #ruby
dminuoso has joined #ruby
ta_ has joined #ruby
skade has quit [Ping timeout: 244 seconds]
mozzarella has quit [Ping timeout: 244 seconds]
jenrzzz has quit [Ping timeout: 276 seconds]
aegis3121 has joined #ruby
indistylo has quit [Remote host closed the connection]
hogetaro has quit [Quit: Leaving...]
rcvalle has joined #ruby
JeanCarloMachado has quit [Ping timeout: 244 seconds]
firstdayonthejob has joined #ruby
govg has quit [Ping timeout: 252 seconds]
AzureStigma is now known as AzureStigma|Away
dminuoso has quit [Ping timeout: 240 seconds]
AzureStigma|Away is now known as AzureStigma
AzureStigma is now known as AzureStigma|Away
AzureStigma|Away has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
alfiemax has quit [Ping timeout: 244 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
govg has joined #ruby
TPug has joined #ruby
raldu has joined #ruby
terlar has joined #ruby
LiohAu has quit [Quit: LiohAu]
skade has joined #ruby
ponga has quit []
pmyjavec has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ChiefAlexander has quit [Remote host closed the connection]
diegoviola has joined #ruby
rgiscard has quit [Quit: Reconnecting]
teclator has quit [Remote host closed the connection]
rgiscard has joined #ruby
mozzarella has joined #ruby
memorasus has joined #ruby
govg has quit [Ping timeout: 240 seconds]
AzureStigma has joined #ruby
kavanagh has joined #ruby
govg has joined #ruby
uri has joined #ruby
whathappens has quit [Read error: Connection reset by peer]
whathappens has joined #ruby
bronson has joined #ruby
macsteps has quit [Remote host closed the connection]
skade has quit [Ping timeout: 258 seconds]
LoneHermit has joined #ruby
cyphase has quit [Ping timeout: 252 seconds]
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<atmosx>
BTC + Ruby \o/
pokalyis has joined #ruby
jaruga___ has quit [Quit: jaruga___]
pmyjavec has joined #ruby
karapetyan has quit [Remote host closed the connection]
LoneHermit has quit [Ping timeout: 265 seconds]
rodfersou|lunch is now known as rodfersou
karapetyan has joined #ruby
cyphase has joined #ruby
tomchapi_ has joined #ruby
<Papierkorb>
Automatic money laundering. Nice.
SilverKey has quit [Read error: Connection reset by peer]
SilverKey has joined #ruby
pandaant has quit [Remote host closed the connection]
Cohedrin has joined #ruby
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pokalyis has joined #ruby
last_staff has joined #ruby
blackmes1 has joined #ruby
joonty has quit [Quit: This computer has gone to sleep]
whathappens has quit [Read error: Connection reset by peer]
AndrewIsHere has quit [Remote host closed the connection]
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
nando293921 has quit [Ping timeout: 276 seconds]
hahuang61 has joined #ruby
<reisei>
hi, all! I have a question: how can I iterate an array until I found the special element, 'a'-letter for example? I need to count elements until this special element.
AndrewIsHere has joined #ruby
<eam>
reisei: #each is pretty good for iterating
<jhass>
if it isn't performance critical, .take_while { }.size
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
<reisei>
jhass: thanks! I'll try that.
<eam>
actually, if you want the location try #find_index
<eam>
probably both cleanest and fastest
<reisei>
eam: but how can I count symbols with #each?
<eam>
>> %w{b c d a e f}.find_index("a")
hahuang61 has quit [Ping timeout: 250 seconds]
whathappens has quit [Read error: Connection reset by peer]
<eam>
more generally, you can always use #each and break() when you want to stop
Bsoom_23_ has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
flashpoint9 has quit [Ping timeout: 264 seconds]
uri has quit [Quit: --]
uri has joined #ruby
kavanagh has joined #ruby
hahuang61 has joined #ruby
synthroid has quit []
tables has quit [Read error: Connection reset by peer]
<reisei>
eam: thanks a lot!
tables has joined #ruby
pawnbox has quit [Remote host closed the connection]
kus has joined #ruby
kus has quit [Max SendQ exceeded]
aegis3121 has joined #ruby
quakephil has joined #ruby
<quakephil>
http://pastebin.ca/3682635 how come I'm getting blanks when I try to reference the indexes? I think I'm missing something basic ruby voodoo...?
gnufied has joined #ruby
minimalism has joined #ruby
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
jgt2 has quit [Read error: Connection reset by peer]
<jhass>
also I recommend p instead of puts for debug printing
Bsoom_23 has joined #ruby
Bsoom_23_ has quit [Ping timeout: 276 seconds]
kjellpropell has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ged has joined #ruby
djbkd has joined #ruby
tomphp has joined #ruby
Neobenedict has quit [Ping timeout: 264 seconds]
jrafanie_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Neobenedict has joined #ruby
jgt2 has joined #ruby
pmyjavec has joined #ruby
tables has quit [Read error: Connection reset by peer]
Makkiel has joined #ruby
rileyy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
klautcomputing has quit [Ping timeout: 244 seconds]
dminuoso has joined #ruby
apneic has quit [Remote host closed the connection]
Puffball has quit [Read error: Connection reset by peer]
ChiefAlexander has quit [Quit: Leaving...]
vuoto has quit [Ping timeout: 240 seconds]
vuoto has joined #ruby
<Makkiel>
cri cri
ldnunes has quit [Quit: Leaving]
Puffball has joined #ruby
soulisson has quit [Ping timeout: 258 seconds]
malconis has joined #ruby
klautcomputing has joined #ruby
<soLucien>
how can i create a getter only for a variable ?
cd-rum has joined #ruby
tables has joined #ruby
rodfersou has quit [Quit: leaving]
<soLucien>
attr_accessor is both a getter and a setter
<soLucien>
i would like to create a getter only .. is this level of encapsulation possible in ruby ?
playfullyExist has quit [Quit: irc]
dminuoso has quit [Ping timeout: 265 seconds]
karapetyan has joined #ruby
<Makkiel>
attr_reader #getter
<Makkiel>
attr_writer # setter
<Makkiel>
so, if you want to create a getter only, you should use attr_reader :var
dionysus69 has quit [Ping timeout: 258 seconds]
uri has quit [Quit: --]
ItSANgo has joined #ruby
pawnbox has joined #ruby
karapetyan has quit [Ping timeout: 244 seconds]
ico has quit []
<soLucien>
cool, thanks Makkiel
cd-rum_ has joined #ruby
cd-rum has quit [Ping timeout: 250 seconds]
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ddffg has quit [Quit: Leaving]
Rodya_ has quit [Remote host closed the connection]
gnufied has quit [Ping timeout: 250 seconds]
bronson has quit [Read error: Connection reset by peer]
pawnbox has quit [Ping timeout: 250 seconds]
bronson has joined #ruby
pawnbox has joined #ruby
tvon has joined #ruby
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cdg_ has quit [Ping timeout: 244 seconds]
workmad3 has joined #ruby
byteflame has quit [Ping timeout: 258 seconds]
tyang has quit [Ping timeout: 240 seconds]
der-landgraf has joined #ruby
ruskie has quit [Excess Flood]
ruskie has joined #ruby
ramortegui has quit [Remote host closed the connection]
Rodya_ has joined #ruby
cjbrambo has joined #ruby
LoneHermit has joined #ruby
finisherr has quit [Quit: finisherr]
ruid has joined #ruby
Rodya_ has quit [Remote host closed the connection]
leea has joined #ruby
der-landgraf has quit [Ping timeout: 240 seconds]
postmodern has quit [Ping timeout: 250 seconds]
vuoto has quit [Remote host closed the connection]
LoneHermit has quit [Ping timeout: 244 seconds]
Rodya_ has joined #ruby
Kyhz has quit [Ping timeout: 258 seconds]
der-landgraf has joined #ruby
GinoMan2440 has quit [Ping timeout: 250 seconds]
cd-rum has joined #ruby
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Bsoom_23_ has joined #ruby
shinnya has joined #ruby
Bsoom_23 has quit [Ping timeout: 244 seconds]
Neobenedict has quit [Ping timeout: 276 seconds]
dhollinger has joined #ruby
ur5us has joined #ruby
pokalyis has joined #ruby
cd-rum_ has quit [Ping timeout: 252 seconds]
LoneHerm_ has joined #ruby
jenrzzz has joined #ruby
Neobenedict has joined #ruby
Neobenedict has quit [Changing host]
Neobenedict has joined #ruby
pokalyis has quit [Max SendQ exceeded]
Makkiel has quit []
pokalyis has joined #ruby
JmcC has quit [Quit: WeeChat 1.5]
cdg has joined #ruby
mtkd has quit [Ping timeout: 244 seconds]
cdg has quit [Read error: Connection reset by peer]
Cohedrin has joined #ruby
hutch34 has joined #ruby
Bsoom_23_ has quit [Remote host closed the connection]
mtkd has joined #ruby
Bsoom_23 has joined #ruby
postmodern has joined #ruby
Rodya_ has quit [Remote host closed the connection]
Bsoom_23 has quit [Read error: Connection reset by peer]
sepp2k1 has quit [Read error: Connection reset by peer]
Bsoom_23 has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
rgiscard has quit [Ping timeout: 244 seconds]
jenrzzz_ has joined #ruby
Bsoom_23 has joined #ruby
minotep has quit [Ping timeout: 252 seconds]
hutch34 has quit [Ping timeout: 240 seconds]
Bsoom_23 has quit [Read error: Connection reset by peer]
Bsoom_23 has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
Neobenedict has quit [Ping timeout: 265 seconds]
Neobenedict has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
reisei has quit [Ping timeout: 250 seconds]
Bsoom_23 has joined #ruby
Bsoom_23_ has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby
Bsoom_23_ has quit [Read error: Connection reset by peer]
hutch34 has joined #ruby
Bsoom_23 has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
Bsoom_23 has joined #ruby
karapetyan has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
Bsoom_23 has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
Bsoom_23 has joined #ruby
flashpoint9 has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
arquebus has joined #ruby
Bsoom_23 has joined #ruby
teclator has joined #ruby
hutch34 has quit [Ping timeout: 250 seconds]
Bsoom_23 has quit [Read error: Connection reset by peer]
marxarelli is now known as marxarelli|afk
pokalyis has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Bsoom_23 has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
GinoMan2440 has joined #ruby
OTORelic2 has quit [Ping timeout: 264 seconds]
cdg has joined #ruby
LoneHerm_ has quit [Remote host closed the connection]
Bsoom_23 has joined #ruby
<arquebus>
hello, Im trying to make an initialize method for a class that will act as a standalone object, Im trying to pass in a hash argument to the initialize method and I keep getting an error saying it cant convert a simbol to an integer. Im not even sure if its possible to make an initialize method for a standalone class object, here is part of the code: http://codepad.org/FuvD0le5
Bsoom_23 has quit [Read error: Connection reset by peer]
fmcgeough has quit [Quit: fmcgeough]
Rodya_ has joined #ruby
speakingcode has quit [Ping timeout: 240 seconds]
pokalyis has joined #ruby
Bsoom_23 has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
LoneHerm_ has joined #ruby
Bsoom_23 has joined #ruby
Bsoom_23_ has joined #ruby
Bsoom_23_ has quit [Read error: Connection reset by peer]
Bsoom_23 has quit [Read error: Connection reset by peer]
Bsoom_23 has joined #ruby
Yonk has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
Bsoom_23 has joined #ruby
sumobob has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
Bsoom_23 has joined #ruby
Spami has joined #ruby
ruby-lang779 has quit [Ping timeout: 250 seconds]
Bsoom_23 has quit [Read error: Connection reset by peer]
Bsoom_23 has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
Bsoom_23 has quit [Read error: Connection reset by peer]
<arquebus>
hello, Im trying to make an initialize method for a class that will act as a standalone object, Im trying to pass in a hash argument to the initialize method and I keep getting an error saying it cant convert a simbol to an integer. Im not even sure if its possible to make an initialize method for a standalone class object, here is part of the code: http://codepad.org/FuvD0le5
soulisson has joined #ruby
Bsoom_23 has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
Bsoom_23 has joined #ruby
pawnbox has quit [Ping timeout: 244 seconds]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Es0teric has quit [Quit: Computer has gone to sleep.]
Bsoom_23 has quit [Read error: Connection reset by peer]
jgt2 has quit [Quit: WeeChat 1.4]
Bsoom_23 has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
jgt has joined #ruby
Bsoom_23 has joined #ruby
theunraveler has quit [Remote host closed the connection]
tables has quit [Ping timeout: 265 seconds]
arquebus has quit [Client Quit]
Bsoom_23 has quit [Read error: Connection reset by peer]
Bsoom_23 has joined #ruby
klautcomputing has quit [Ping timeout: 244 seconds]
Bsoom_23 has quit [Read error: Connection reset by peer]
nankyokusei has quit [Ping timeout: 250 seconds]
Bsoom_23 has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
Bsoom_23 has joined #ruby
dminuoso has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
the_rhizo2 has joined #ruby
Bsoom_23 has joined #ruby
axl_ has quit [Quit: axl_]
Bsoom_23 has quit [Read error: Connection reset by peer]
axl_ has joined #ruby
Bsoom_23 has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
Kyhz has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
dhollinger has quit [Quit: WeeChat 1.5]
Bsoom_23 has joined #ruby
flashpoint9 has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
Bsoom_23 has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
tables has joined #ruby
Bsoom_23 has joined #ruby
LoneHerm_ has quit [Remote host closed the connection]
Bsoom_23 has quit [Read error: Connection reset by peer]
dminuoso has quit [Ping timeout: 250 seconds]
Bsoom_23 has joined #ruby
sulky_ has quit [Ping timeout: 276 seconds]
Bsoom_23 has quit [Read error: Connection reset by peer]
yfeldblum has quit [Read error: Connection reset by peer]
Bsoom_23 has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
Dimik has quit []
yfeldblum has joined #ruby
skade has joined #ruby
sulky has joined #ruby
flashpoint9 has quit [Ping timeout: 250 seconds]
DJTrey has quit [Ping timeout: 250 seconds]
Bsoom_23 has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
A_Drone has joined #ruby
Bsoom_23 has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
Bsoom_23 has joined #ruby
Bsoom_23 has quit [Read error: Connection reset by peer]
<baweaver>
!connection Bsoom_23
firstdayonthejob has quit [Ping timeout: 276 seconds]
apneic has joined #ruby
pmyjavec has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
crankhar1er has joined #ruby
spudowiar has joined #ruby
A_Drone has quit [Ping timeout: 244 seconds]
rkazak has joined #ruby
tyang has joined #ruby
AndrewIsHere has quit []
gix has quit [Ping timeout: 258 seconds]
ruid has quit [Ping timeout: 240 seconds]
stuartrexking has joined #ruby
aegis3121 has quit [Ping timeout: 240 seconds]
Torrone has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
polishdub has quit [Quit: Leaving]
yfeldblum has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby
<Yonk>
arquebus why not use a class instance variable as that stand alone object if it needs to be shared amongst multiple instanstiated objects of that class
hutch34 has joined #ruby
eljimmy has quit [Quit: This computer has gone to sleep]
<Yonk>
@@ is class instance variables and @ are regular instance variables
<Yonk>
@@ is available to all instances of that class and @ is available to only each instance of that class
davidw has quit [Ping timeout: 276 seconds]
blackgoat has quit [Ping timeout: 240 seconds]
sumobob has quit [Ping timeout: 250 seconds]
<Yonk>
also in ruby everything is an object even a Hash
<ruby[bot]>
Yonk: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
Vingador has joined #ruby
flashpoint9 has joined #ruby
etetz has quit [Remote host closed the connection]
etetz has joined #ruby
da3mon has quit [Quit: cya...]
theunraveler has joined #ruby
theunraveler has quit [Remote host closed the connection]
<Yonk>
ruby[bot]: in a dynamically typed language you're passing by reference so you can throw anything at it as an argument. all it cares about is that you're giving it an argument when you're asking for one
etetz has quit [Ping timeout: 276 seconds]
<Yonk>
using the singular splat operator means it will take in many arguments if I remember correctly. So whatever you name that argument will be treated as an array. and since everything is an object it will get put into the array. the arrays in ruby can hold many types of things.
stuartrexking has quit [Ping timeout: 240 seconds]
l4v2 has quit [Quit: l4v2]
stuartrexking has joined #ruby
axsuul has joined #ruby
gix has joined #ruby
p0p0pr37 has quit [Quit: Going offline, see ya! (www.adiirc.com)]
stamina has quit [Ping timeout: 276 seconds]
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
jhack has quit [Quit: jhack]
jhack has joined #ruby
blackmesa has quit [Ping timeout: 244 seconds]
nickjj has quit [Read error: Connection reset by peer]
stuartre1king has joined #ruby
stuartrexking has quit [Ping timeout: 250 seconds]
flashpoint9 has quit [Ping timeout: 250 seconds]
<soulisson>
Hi, I'm using udp socket how can I set a timeout for the recvfrom method?
nickjj has joined #ruby
rgiscard has quit [Ping timeout: 276 seconds]
tables has quit [Read error: Connection reset by peer]
<matthewd>
soulisson: Use recvfrom_nonblock
l4v2 has joined #ruby
spider-mario has quit [Remote host closed the connection]
Vingador has quit [Remote host closed the connection]
<soulisson>
matthewd, how do I know then if I received data?
<matthewd>
If it returns, you received data; if it raises, you didn't.
ur5us has quit [Remote host closed the connection]
GodFather has joined #ruby
<soulisson>
matthewd, but given network latency, if it returns immediately isn't data a problem?
nofxx has quit [Ping timeout: 276 seconds]
<soulisson>
Does it mean I have to the wait manually with a sleep?
<matthewd>
You keep reading (and waiting, with #select) until you have the data you want
<soulisson>
matthewd, oh ok, thanks
solars has quit [Ping timeout: 252 seconds]
maloik has quit [Remote host closed the connection]
maloik has joined #ruby
blackgoat has joined #ruby
ereslibre has quit [Quit: No Ping reply in 180 seconds.]
ereslibre has joined #ruby
saneax_AFK is now known as saneax
dminuoso has joined #ruby
saneax is now known as Guest7941
roflmyeggo has joined #ruby
whathappens has quit [Remote host closed the connection]
whathappens has joined #ruby
LoneHerm_ has joined #ruby
dminuoso has quit [Ping timeout: 240 seconds]
kavanagh has quit [Quit: That's all folks!]
whathappens has quit [Ping timeout: 258 seconds]
A_Drone has joined #ruby
solars has joined #ruby
jhack has quit [Quit: jhack]
A_Drone has quit [Ping timeout: 265 seconds]
symm-_ has joined #ruby
symm- has quit [Ping timeout: 265 seconds]
memorasus has quit [Ping timeout: 250 seconds]
ur5us has joined #ruby
hutch34 has quit [Ping timeout: 250 seconds]
Rodya_ has quit [Remote host closed the connection]
memorasus has joined #ruby
ur5us has quit [Ping timeout: 265 seconds]
axl__ has joined #ruby
leea_ has joined #ruby
psyq has joined #ruby
axl_ has quit [Ping timeout: 240 seconds]
axl__ is now known as axl_
psyq has quit [Changing host]
psyq has joined #ruby
leea has quit [Ping timeout: 244 seconds]
Torrone has quit [Quit: This computer has gone to sleep]
psyq has left #ruby [#ruby]
davidw has joined #ruby
soulisson has left #ruby ["Quitte"]
mikecmpbll has quit [Quit: inabit.]
SilverKey has quit [Quit: Halted.]
jud^ is now known as jud
<quakephil>
jhass: so how would I reference in my case? doc[:id] ?
jud has quit [Changing host]
jud has joined #ruby
<jhass>
yes
<pizzaops>
Is there something like pop that doesn't modify the original array
<matthewd>
pizzaops: last ?
the_rhizo2 has quit [Ping timeout: 260 seconds]
leea_ is now known as leea
<pizzaops>
matthewd: sorry I should be more clear. Getting the last object is the easy part. I want something that removes the last element of an array and returns it
<pizzaops>
returns a new array
<pizzaops>
so basically foo = myarray.last; bar = myarray.remove_last_object, bar should be myarray less the foo value
<pizzaops>
I can certainly implement something that does this i'm just curious im missing a builtin
Spami has quit [Quit: This computer has gone to sleep]
LoneHerm_ has quit [Ping timeout: 258 seconds]
Spami has joined #ruby
<matthewd>
bar = myarray.dup.tap(&:pop) and *bar, _ = myarray are the options that come to mind
<matthewd>
There's drop, but that's for the other end of the array (i.e., working with head:tail)
marxarelli|afk is now known as marxarelli
the_rhizo2 has joined #ruby
marxarelli is now known as marxarelli|afk
rkazak has quit [Quit: Sleep.....ing....]
swills has joined #ruby
aries_liuxueyang has quit [Ping timeout: 258 seconds]