involans has quit [Read error: Connection reset by peer]
involans has joined #ruby
Snowy has joined #ruby
sarink has joined #ruby
involans has quit [Ping timeout: 272 seconds]
dviola has quit [Quit: WeeChat 2.5]
_whitelogger has joined #ruby
bjpenn has joined #ruby
cd has quit [Quit: cd]
bjpenn has quit [Read error: Connection reset by peer]
bjpenn has joined #ruby
pygmypuppy has quit [Ping timeout: 248 seconds]
cyclonis has joined #ruby
cyclonis has quit [Remote host closed the connection]
code_zombie has quit [Quit: Leaving]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
tdy4 has joined #ruby
Snowy has quit [Ping timeout: 258 seconds]
fphilipe has joined #ruby
fphilipe has quit [Ping timeout: 248 seconds]
Swyper has joined #ruby
polysics has joined #ruby
<polysics>
sup
Swyper has quit [Remote host closed the connection]
DTZUZO has joined #ruby
<polysics>
I have an amnesia moment. Is there a way to define an array of constants on a class?
zacts has joined #ruby
jenrzzz has joined #ruby
<baweaver>
polysics: how so?
Swyper has joined #ruby
<polysics>
I am dealing with an API that has lengthy event names, and they are separated on a few groups
<polysics>
so I'd like to do something like CALL_STATE::RINGING to reference them
<polysics>
I guess I can just name them TYPE_SUBTYPE, but it was more of a generic question I came up with
<baweaver>
Hashes, possibly
<polysics>
because the actual name is something like 'event.calling.call.call_state.ringing' because I assume it is mapped from some undelying relationship
<polysics>
how would that look, please?
<baweaver>
So you need an arbitrarily deep structure of events?
<polysics>
no, I can make do with two levels
<polysics>
let's say "call_state.ringing" is what matters
<baweaver>
Just make a module that wraps a set of constants
<polysics>
there sill be "call_connect.started", "call_play.finished" etc
<polysics>
and how would the constants be arranged?
<baweaver>
class Something; module GroupA; CONSTS
<polysics>
oh, so there is no way to do a hash of constants, gotcha
<baweaver>
Hash keys could be anything
<polysics>
I was almost sure I had seen it somewhere but I was probably seein things, I guess
Swyper has quit [Remote host closed the connection]
<polysics>
baweaver: you mean something like this?
<polysics>
module CallState
<polysics>
RINGING = 'long_event_name'
<polysics>
end
<polysics>
module CallPlay
<polysics>
STARTED = 'some more long name'
<polysics>
end
<baweaver>
Use a gist
<polysics>
oops wtf, sorry
<polysics>
yes, my bad
<baweaver>
but yeah
<polysics>
wrong focused window.
<polysics>
yes, thinking about it, I can't think of a syntax that would allow for an actual hash of constants to be defined
<polysics>
is a module name in all caps bad-looking?
<polysics>
so that it is clear it is only a constant holder
<polysics>
you can ofc have an hash as a constant but that has a confusing syntax to use
<Norrin>
1) when it says **options, is that like variable arguments? casting everything remaining into an "options" hash?
<Norrin>
2) the keys to the hash are symbols? `add_reference(:products, :user, type: :string)` passing "type" as a symbol?
THE_GFR|WORK has joined #ruby
<THE_GFR|WORK>
hey everyone have a ruby/ruby-on-rails system and I was wondering if anyone here knew of a gem that might give google sheets like saving ability where text typed into specific areas is automatically saved?
alem0lars has quit [Remote host closed the connection]
vondruch has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
schne1der has joined #ruby
<Norrin>
NL3limin4t0r, interesting. why do the keys have to be symbols?
andikr has quit [Remote host closed the connection]
<NL3limin4t0r>
Norrin: I don't know exactly why, maybe someone else can tell you. What I do know is that keyword arguments should always be symbols. If you do want to allow string and other types as key simply create an optional positional argument.
<leftylink>
indeed they take on the same form at the call site. as a logical consequence of this, it also means that at the call site, even `:sym => v` is substitutable for `sym: v`
<Norrin>
&>> def test(*options); p options; end; a="test"; test(1,2,3, a: "a string")
<Norrin>
hmm so array capture will capture a hash even when the method accepts keyword arguments, as long as it's in the a => b form instead of the a: b form
<leftylink>
the "as long as" does not apply
<leftylink>
actually, I guess kind of
za1b1tsu has quit [Remote host closed the connection]
<NL3limin4t0r>
symbols can also be in that form `:a => 1`
<leftylink>
it really does not matter what syntax was used at the call site, as can be seen in the `def f(a: :adef, b: :bdef) p [a, b] end; f(:a => :hello, :b => :world)` example.
<NL3limin4t0r>
&>> def test(*options, a: nil); p options,a; end; a=22; test(1,2,3, a => "a string", a: 1)
<havenwood>
NL3limin4t0r: In 2.6.3: def test(*options, a: nil); p options,a; end; a=22; test(1,2,3, a => "a string", a: 1)
<havenwood>
#=> [[1, 2, 3, {22=>"a string"}], 1]
matheusmoreira has quit [Ping timeout: 246 seconds]
matheusmoreira has joined #ruby
<Norrin>
NL3limin4t0r interesting. seems like it glued the two together into one hash
<NL3limin4t0r>
havenwood: Didn't know that, but it's good to know. I generally only read the x.x.0 patch notes, since those mostly include the new features.
<NL3limin4t0r>
Which Ruby version was it added? I can't seem to find it in the 2.6.1, 2.6.2 or 2.6.3 change log. I'm not in the mood to walk through the commit log at this time.
orbyt_ has joined #ruby
lord4163 has joined #ruby
<THE_GFR|WORK>
NL3limin4t0r: thanks!
<THE_GFR|WORK>
NL3limin4t0r: I'm looking for a gem that I can put into my ruby project...
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
GodFather has quit [Ping timeout: 246 seconds]
Swyper has quit []
absolutejam3 has joined #ruby
dbugger has quit [Quit: Leaving]
absolutejam3 has quit [Client Quit]
TomyWork has quit [Ping timeout: 246 seconds]
johnny56 has quit [Ping timeout: 272 seconds]
gix has joined #ruby
conta has joined #ruby
absolutejam has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aupadhye has quit [Quit: Leaving]
<Norrin>
havenwood what feature was removed?
<Norrin>
all i can see if an enhancement, distinguishing the hash from the keyword arg
cyclonis_ has joined #ruby
<havenwood>
Norrin: In 2.6.0, a prohibition was added to prevent passing both Symbol and non-Symbol keys at once.
<havenwood>
Norrin: After 2.6.1 release, core team decided it needed to be backed out.
cyclonis_ has quit [Read error: Connection reset by peer]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
conta has quit [Quit: conta]
<NL3limin4t0r>
For some reason I thought that behaviour was present in older versions too. But testing it in 2.4.1 and 2.5.5 it seems to work fine. I have no clue where I got the idea from then. 😅
bjpenn has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
queip has quit [Ping timeout: 248 seconds]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
conta has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
akem-lnvo has quit [Ping timeout: 272 seconds]
Esa_ has quit []
lxsameer has quit [Ping timeout: 248 seconds]
queip has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
Rudd0 has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
kyrylo has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
kyrylo has quit [Read error: Connection timed out]
kyrylo has joined #ruby
brendan- has joined #ruby
absolutejam has quit [Ping timeout: 245 seconds]
rafadc has quit [Remote host closed the connection]
NL3limin4t0r is now known as NL3limin4t0r_afk
queip has quit [Ping timeout: 244 seconds]
conta has quit [Quit: conta]
megamos has quit [Ping timeout: 268 seconds]
rafadc has joined #ruby
queip has joined #ruby
Guest42592 has quit [Ping timeout: 272 seconds]
cliluw has quit [Ping timeout: 244 seconds]
cliluw has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
Guest42592 has joined #ruby
jenrzzz has joined #ruby
fr3tz0r has joined #ruby
akem-lnvo has joined #ruby
alem0lars has joined #ruby
akem-hp has quit [Remote host closed the connection]
absolutejam has joined #ruby
snickers has joined #ruby
megamos has joined #ruby
suukim has quit [Quit: Konversation terminated!]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Inline has quit [Quit: Leaving]
orbyt_ has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Excess Flood]
colechristensen has quit [Read error: Connection reset by peer]
colechristensen has joined #ruby
reber has joined #ruby
johnny56 has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
johnny56 has quit [Ping timeout: 272 seconds]
code_zombie has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ascarter has joined #ruby
yalue has quit [Quit: Leaving]
kyrylo has joined #ruby
ElFerna has joined #ruby
colechristensen has quit [Read error: Connection reset by peer]
colechr60 has joined #ruby
<fr3tz0r>
I'm trying to use self.text_input in gosu in a seperate class (Input) than my window class (which inherits Gosu::Window). I passed a reference to an instance of the window to the Input class and call window.text_input but get undefined method text_input, Why?
kyrylo has quit [Ping timeout: 245 seconds]
ljarvis has joined #ruby
jonarrien has joined #ruby
<ljarvis>
:)
psilly0 has joined #ruby
sphenxes has quit [Remote host closed the connection]