<FromGitter>
<drosehn> @jwoertink - your original tactic would work, but the common-method needs to be *named* `initialize` instead of `setup`. Consider issue #3334 , starting at the response I made on Oct 13, 2016.
mgarciaisaia has quit [Read error: Connection reset by peer]
mgarciaisaia has joined #crystal-lang
_whitelogger has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
mgarciaisaia has quit [Quit: Leaving.]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
_whitelogger has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
chatter29 has joined #crystal-lang
<chatter29>
hey guys
<chatter29>
allah is doing
<chatter29>
sun is not doing allah is doing
<chatter29>
to accept islam say that i bear witness that there is no deity worthy of worship except allah and muhammad peace be upon him is his slave and messenger
<VectorGraphics>
Does allah prefer tabs or spaces?
<FromGitter>
<tekjar> Hi. How do I create enum which raises exception for invalid values?
pawnbox has joined #crystal-lang
j2k has joined #crystal-lang
j2k has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
olek_poz has joined #crystal-lang
j2k has joined #crystal-lang
gloscombe has joined #crystal-lang
j2k has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Raimondii has joined #crystal-lang
gloscombe has quit [Ping timeout: 256 seconds]
jabb has quit [Ping timeout: 260 seconds]
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
gloscombe has joined #crystal-lang
Gk-1wm-su has joined #crystal-lang
Gk-1wm-su has quit [Excess Flood]
<FromGitter>
<lhz> @tekjar: If you have an enum `Foo`, you can do `Foo.from_value(i)`
soveran has quit [Remote host closed the connection]
<FromGitter>
<tekjar> @lhz But I want it to return a custom exception
<FromGitter>
<lhz> @tekjar: wrap it in a begin/rescue/end and raise your custom exception in the rescue block
<FromGitter>
<tekjar> @lhz Cool Thanks. So it's not possible to call `QoS.from_num` method (the one in the example link)
<FromGitter>
<tekjar> ?
<FromGitter>
<lhz> @tekjar: Can't see the code anymore, but as long as you define it as a class method `def self.from_num` it should work to just add a rescue in there to raise a custom exception.
<FromGitter>
<tekjar> @lhz Ohh. Ok. Thanks alot :)
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 240 seconds]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
bew78 has joined #crystal-lang
<bew78>
How can I set the i_know_what_im_doing flag ?
pawnbox has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
soveran has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<FromGitter>
<jwoertink> Thanks @drosehn I originally was using the calling initialize internally, but it was pointed out by someone else that it felt weird to do that. I personally don't have a strong opinion either way so I'm all open to suggestions about implementation
mgarciaisaia has joined #crystal-lang
<FromGitter>
<drosehn> Well in the discussion I linked to, asterite followed up to say that tactic seemed fine to him, and he provided an `initialize`-based solution which looked nicer than the one I suggested. :smile:
<FromGitter>
<jwoertink> yeah. He was the one that gave me the original suggestion a while back. I guess as long as there's no weird internal backfires from implementing like that, then it's safe
<FromGitter>
<drosehn> I think we can trust asterite that this will continue to work okay! :smiley:
<FromGitter>
<lhz> This is on Ubuntu 16.04.1, I have the sdl(-dev) packages installed.
<FromGitter>
<lhz> Suspect it could be because the library is installed under `/usr/lib/x86_64-linux-gnu` while the cc command contains only `-L/usr/lib -L/usr/local/lib`, but don't know how to make it look elsewhere.
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: https://git.io/vy4Vh
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
Ven has quit [Ping timeout: 260 seconds]
Ven has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ven has quit [Ping timeout: 260 seconds]
Ven has joined #crystal-lang
jabb has joined #crystal-lang
olek_poz has quit [Ping timeout: 260 seconds]
Liothen has quit [*.net *.split]
Liothen has joined #crystal-lang
Ven has quit [Ping timeout: 260 seconds]
Ven has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alxnlssn has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
soveran has quit [Remote host closed the connection]
<FromGitter>
<ltran> I'm trying to save Time.now and using that value to calculate some timings later. But I noticed if I save current_time = Time.now, current_time will a different value later. Anyway to get the time for the moment of time?
olek_poz has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
genericpenguin has joined #crystal-lang
genericpenguin has quit [Client Quit]
<Papierkorb>
ltran, `current_time` won't change by itself
<FromGitter>
<ltran> maybe it is because I'm using it inside icr? ```