ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.31.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
alexherbo2 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 265 seconds]
yukai has joined #crystal-lang
dwdv has quit [Ping timeout: 246 seconds]
duane has quit [Ping timeout: 250 seconds]
<FromGitter> <yorci> property is nilable but .to_json emits null how can i prevent that?
<FromGitter> <yorci> using json.mapping
<FromGitter> <Blacksmoke16> are you using `JSON.mapping` or `JSON::Serializable`
<FromGitter> <Blacksmoke16> nvm
<FromGitter> <Blacksmoke16> `emit_null` default is false, so sure you dont have that set to true?
<FromGitter> <yorci> yes, actually i set it manually false also
<FromGitter> <yorci> but still emits
<FromGitter> <Blacksmoke16> able to make an example? https://play.crystal-lang.org/#/cr
<FromGitter> <yorci> banned_at: {type: Time?, emit_null: false, converter: Time::EpochMillisConverter}, ⏎ the property variable
<FromGitter> <Blacksmoke16> got an example?
<FromGitter> <yorci> let me make an example
<FromGitter> <Blacksmoke16> whats the problem?
<FromGitter> <yorci> banned_at must set to nil
<FromGitter> <yorci> as json
<FromGitter> <Blacksmoke16> oh so you *want* to emit null
<FromGitter> <Blacksmoke16> then just make `emit_null: true`
<FromGitter> <yorci> oh that means hide nulls? :D
<FromGitter> <Blacksmoke16> it controls if `null` values are emitted yes
<FromGitter> <yorci> oh yes, sorry my bad
<FromGitter> <yorci> thanks for fast reply
<FromGitter> <Blacksmoke16> :p np
duane has joined #crystal-lang
<FromGitter> <yorci> by the way default emit_null is false right? so if i have json string witch is has null parameters and i parse it with my class.from_json it must be disappear if its null? ⏎ @Blacksmoke16
<FromGitter> <Blacksmoke16> `emit_null` is just used for serialization
<FromGitter> <Blacksmoke16> if you deserialize some json that has null values, those ivars would just be nil
<FromGitter> <yorci> i see
<FromGitter> <yorci> thank you so much
<FromGitter> <Blacksmoke16> np
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 240 seconds]
blueberrypie has quit [Quit: leaving]
blueberrypie has joined #crystal-lang
_whitelogger has joined #crystal-lang
_whitelogger has joined #crystal-lang
ht_ has joined #crystal-lang
DTZUZO has quit [Ping timeout: 265 seconds]
livcd has quit [Quit: Lost terminal]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 276 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 265 seconds]
DTZUZO has joined #crystal-lang
dwdv has joined #crystal-lang
DTZUZO has quit [Ping timeout: 276 seconds]
DTZUZO has joined #crystal-lang
ht_ is now known as _ht
alexherbo2 has joined #crystal-lang
DTZUZO has quit [Ping timeout: 246 seconds]
_ht is now known as 7ITAAPNYI
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 276 seconds]
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
DTZUZO has joined #crystal-lang
alexherbo2 has joined #crystal-lang
DTZUZO has quit [Ping timeout: 246 seconds]
alexherbo2 has quit [Read error: Connection reset by peer]
alexherbo2 has joined #crystal-lang
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 265 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 265 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 250 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 250 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
alexherbo2 has quit [Read error: Connection reset by peer]
alexherbo2 has joined #crystal-lang
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 265 seconds]
livcd has joined #crystal-lang
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 265 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 276 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
<FromGitter> <christopherzimmerman> I have a pattern that I keep coming across and I can't figure out the best way to infer a type: ⏎ ⏎ def outer(a, b) ⏎ index = 0 ⏎ a.flat_iter.each do |i| ... [https://gitter.im/crystal-lang/crystal?at=5de27b1eb065c6433c12027f]
<FromGitter> <christopherzimmerman> Is there a good way to determine what type `outer` will yield for its inputs so I can allocate that pointer before I actually call outer?
DTZUZO has quit [Ping timeout: 245 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 265 seconds]
<Yxhuvud> um, you are not even collecting the return value of that block.
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 268 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 265 seconds]
gangstacat has quit [Remote host closed the connection]
gangstacat has joined #crystal-lang
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
<FromGitter> <bajro17> How to make embed code like for youtube I want embed videos from my site
DTZUZO has joined #crystal-lang
alexherbo2 has quit [Quit: Ping timeout (120 seconds)]
alexherbo2 has joined #crystal-lang
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
Yxhuvud has quit [Remote host closed the connection]
Yxhuvud has joined #crystal-lang
duane has quit [Ping timeout: 250 seconds]
7ITAAPNYI has quit [Quit: 7ITAAPNYI]
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
<FromGitter> <asterite> @christopherzimmerman to know the blocks' return value you can do `typeof(...)` where `...` is the exact code that you want to call (`outer(a, b) { ... }`)
<FromGitter> <watzon> @bajro17 you mean you want the ability to drop an embed code from your site somewhere else like you can do with youtube videos?
<FromGitter> <watzon> The way youtube does it is by having a specific route for embeds, `youtube.com/embed/{video_id}`, and then their embed links are just iframes. You could also go a different route and have a JS fragment that people include in their site along with a div with a specific class/id, but that way is a little more complicated and not really necessary
oprypin has quit [Quit: Bye]
oprypin has joined #crystal-lang
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5de2fda39319bb5190bd78a5]
<FromGitter> <Blacksmoke16> anyone have some clever ideas on how to handle this? Where since `AService2` is defined first, but depends on `AService`, the ivars are declared in the wrong order ⏎ ⏎ ```@a_service2 = AService2.new(a_service) ⏎ ⏎ @a_service = AService.new("str")``` ⏎ ⏎ So it'll fail saying `Instance variable '@a_service' was used before it was initialized` [https://gi
<FromGitter> ... tter.im/crystal-lang/crystal?at=5de2fdf708d0c961b7c9fd3c]
<FromGitter> <Blacksmoke16> currently im just keeping track of the service names that have been registered, and if they all havent, add the service to the array again which would get processed later, would be ideal if you could sort them beforehand somehow...
<FromGitter> <Blacksmoke16> doesnt help there isnt a `next` keyword in macro land