<mikecmpbll>
conr: the if statement is syntactically unsound, but it's also poorly written. it's usually codesmell when multiple branches of the logical statement return the same value
<conr>
mikecmpbll: would you change line 73-75 to just `return organization if organization.nil? || organization if organization.is_a?(Organization)`?
<conr>
<conr>
oops sorry `return organization if organization.nil? || organization.is_a?(Organization)`?
croberts has joined #ruby
jpn has quit [Ping timeout: 252 seconds]
<mikecmpbll>
conr: no. the only thing that method functionally achieves is assigning @organization to nil when the `organization` passed to `new` is not an instance of Organization. type checking in general isn't a ruby-ish thing to do, so i'd just dispense of the method altogether and question the interface that's being created here.
<mikecmpbll>
if that's too much churn, then the simplest way to do what's currently being done is `organization.is_a?(Organization)
<mikecmpbll>
`return organization if organization.is_a?(Organization)`, afaict.
Al2O3_ has joined #ruby
protektwar has quit [Remote host closed the connection]
<conr>
ok thanks. i found some other things. anything else that sticks out like a sore thumb?
<conr>
mikecmpbll: ^
nirvdrum has joined #ruby
<adam12>
conr: I didn't look too closely, but I'd almost wonder if want a collection of classifier classes, and then just iterate through them by some sort of orchestrator and find the first match.
<adam12>
Then you could have one for just classifying spam, one for just classifying management, etc.
<adam12>
This class does "classify", but perhaps breaks the SRP somewhat by classifying _multiple_ types.
<adam12>
conr: I'd personally make SpamHandler a provided dependency, since you'd want to fake spam during testing and right now it's a constant (aka global).
<adam12>
The indentation if your if/else/if/elsif block is strange too.
<adam12>
If you wrote this from scratch, I'd run it through standardrb and see if it complains about anything.
<conr>
ok thanks
<adam12>
Some methods accept positional args, and some accept named. It might be worth standardizing on one or the other.
<adam12>
I'd pass in TextCategorizer as a dependency too.
<adam12>
And if I was being selfish and this was my own code, the initialize method would do _nothing_ but assign instance variables.
<adam12>
I'd add another constructor, like `build`, that does anything outside of setting instance variables. It makes testing easier.
<adam12>
LMK if this is unclear at all.
<conr>
thanks adam12
dionysus69 has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
fredlinhares has quit [Read error: Connection reset by peer]
fredlinhares has joined #ruby
nirvdrum has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has joined #ruby
nirvdrum has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
nirvdrum has joined #ruby
nirvdrum has quit [Client Quit]
nirvdrum has joined #ruby
protektwar has quit [Remote host closed the connection]
protektwar has joined #ruby
protektwar has joined #ruby
Linux_Kerio has quit [Ping timeout: 268 seconds]
szkl has quit [Quit: Connection closed for inactivity]
protektwar has quit [Remote host closed the connection]
protektwar has joined #ruby
protektwar has joined #ruby
protektwar has quit [Changing host]
nirvdrum has quit [Quit: nirvdrum]
fredlinhares has quit [Read error: Connection reset by peer]
fredlinhares has joined #ruby
protektwar has quit [Remote host closed the connection]
protektwar has joined #ruby
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has quit [Client Quit]
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has joined #ruby
protektwar has quit [Remote host closed the connection]
protektwar has joined #ruby
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has quit [Client Quit]
Assads8 has joined #ruby
until1 has joined #ruby
until1 has quit [Ping timeout: 252 seconds]
Assads8 has quit [Ping timeout: 252 seconds]
sgt_chuckles has joined #ruby
Assads8 has joined #ruby
until1 has joined #ruby
<sgt_chuckles>
is there a more formal way to query APIs besides using httparty?
Assads8 has quit [Quit: quit]
aeris has quit [*.net *.split]
Sankalp has quit [*.net *.split]
Aminda has quit [*.net *.split]
mahlon has quit [*.net *.split]
CalimeroTeknik has quit [*.net *.split]
scottg489 has quit [*.net *.split]
aindilis has quit [*.net *.split]
gcd has quit [*.net *.split]
smp has quit [*.net *.split]
Milos_ has quit [*.net *.split]
NightMonkey has quit [*.net *.split]
IsoLnCHiP has quit [*.net *.split]
dorian_ has quit [*.net *.split]
darabiesvampire has quit [*.net *.split]
glider has quit [*.net *.split]
weaksauc_ has quit [*.net *.split]
Xeago has quit [*.net *.split]
_root has quit [*.net *.split]
cognemo has quit [*.net *.split]
jhawthorn has quit [*.net *.split]
hololeap has quit [*.net *.split]
_ht has quit [*.net *.split]
gr33n7007h has quit [*.net *.split]
Inoperable has quit [*.net *.split]
RetroPunk has quit [*.net *.split]
marahin has quit [*.net *.split]
rhe has quit [*.net *.split]
mjacob has quit [*.net *.split]
skape has quit [*.net *.split]
sam113101 has quit [*.net *.split]
hansolo has quit [*.net *.split]
ralu1 has quit [*.net *.split]
victori has quit [*.net *.split]
dza has quit [*.net *.split]
matoro has quit [*.net *.split]
keyvan has quit [*.net *.split]
jmcgnh has quit [*.net *.split]
FetidToot has quit [*.net *.split]
pvalenta has quit [*.net *.split]
yossarian has quit [*.net *.split]
lagash has quit [*.net *.split]
repo has quit [*.net *.split]
mbarbar has quit [*.net *.split]
itok has quit [*.net *.split]
taiju[m] has quit [*.net *.split]
dka_ has quit [*.net *.split]
comeoooon has quit [*.net *.split]
sol has quit [*.net *.split]
GvJordan has quit [*.net *.split]
clemens3 has quit [*.net *.split]
Hobbyboy has quit [*.net *.split]
arahael has quit [*.net *.split]
bhaak has quit [*.net *.split]
slothby has quit [*.net *.split]
dannyAAM has quit [*.net *.split]
eldritch has quit [*.net *.split]
fredlinhares has quit [*.net *.split]
dionysus69 has quit [*.net *.split]
croberts has quit [*.net *.split]
dstein64 has quit [*.net *.split]
c10l has quit [*.net *.split]
kaivai has quit [*.net *.split]
pgib has quit [*.net *.split]
Pixi has quit [*.net *.split]
egality has quit [*.net *.split]
depesz has quit [*.net *.split]
mahler has quit [*.net *.split]
eam has quit [*.net *.split]
jidar has quit [*.net *.split]
kenichi has quit [*.net *.split]
ua_ has quit [*.net *.split]
until1 has quit [*.net *.split]
John_Ivan has quit [*.net *.split]
mikecmpbll has quit [*.net *.split]
aandre has quit [*.net *.split]
ollysmith has quit [*.net *.split]
perrierjouet has quit [*.net *.split]
sphex has quit [*.net *.split]
nemesit has quit [*.net *.split]
m_antis has quit [*.net *.split]
dostoyevsky2 has quit [*.net *.split]
justache has quit [*.net *.split]
Sophira has quit [*.net *.split]
ikonia has quit [*.net *.split]
benjaminwil has quit [*.net *.split]
fcser has quit [*.net *.split]
Artea has quit [*.net *.split]
Byteflux has quit [*.net *.split]
EdwardIII has quit [*.net *.split]
Henry151 has quit [*.net *.split]
moo has quit [*.net *.split]
yosafbridge has quit [*.net *.split]
hexology has quit [*.net *.split]
kaleido has quit [*.net *.split]
meimei has quit [*.net *.split]
rubin55 has quit [*.net *.split]
Guest9768 has quit [*.net *.split]
cout has quit [*.net *.split]
georgemp has quit [*.net *.split]
niv has quit [*.net *.split]
r0bby has quit [*.net *.split]
Bi[m] has quit [*.net *.split]
polishdub has quit [*.net *.split]
splud has quit [*.net *.split]
heartburn has quit [*.net *.split]
bastelfreak has quit [*.net *.split]
conjunctive has quit [*.net *.split]
miah has quit [*.net *.split]
oz has quit [*.net *.split]
peer has quit [*.net *.split]
vito has quit [*.net *.split]
conr has quit [*.net *.split]
wnd has quit [*.net *.split]
andrea[m]1 has quit [*.net *.split]
Neopolitan has quit [*.net *.split]
Zerock has quit [*.net *.split]
ringo__ has quit [*.net *.split]
Fridtjof has quit [*.net *.split]
jposer has quit [*.net *.split]
cAMP has quit [*.net *.split]
joenoon has quit [*.net *.split]
eof has quit [*.net *.split]
ccooke has quit [*.net *.split]
A_Dragon has quit [*.net *.split]
JSharp has quit [*.net *.split]
Exa has quit [*.net *.split]
dcx has quit [*.net *.split]
con3 has quit [*.net *.split]
asio has quit [*.net *.split]
olspookishmagus has quit [*.net *.split]
pjlsergeant has quit [*.net *.split]
sgt_chuckles has quit [*.net *.split]
until1 has joined #ruby
croberts has joined #ruby
sgt_chuckles has joined #ruby
fredlinhares has joined #ruby
dionysus69 has joined #ruby
conr has joined #ruby
dstein64 has joined #ruby
John_Ivan has joined #ruby
NightMonkey has joined #ruby
gr33n7007h has joined #ruby
Milos_ has joined #ruby
hololeap has joined #ruby
Artea has joined #ruby
bhaak has joined #ruby
GvJordan has joined #ruby
arahael has joined #ruby
depesz has joined #ruby
eam has joined #ruby
mahler has joined #ruby
kenichi has joined #ruby
jidar has joined #ruby
aindilis has joined #ruby
mahlon has joined #ruby
ua_ has joined #ruby
skape has joined #ruby
pgib has joined #ruby
aandre has joined #ruby
CalimeroTeknik has joined #ruby
aeris has joined #ruby
mikecmpbll has joined #ruby
Inoperable has joined #ruby
smp has joined #ruby
gcd has joined #ruby
Sankalp has joined #ruby
Pixi has joined #ruby
kaivai has joined #ruby
IsoLnCHiP has joined #ruby
darabiesvampire has joined #ruby
dorian_ has joined #ruby
_ht has joined #ruby
glider has joined #ruby
RetroPunk has joined #ruby
Xeago has joined #ruby
weaksauc_ has joined #ruby
cognemo has joined #ruby
_root has joined #ruby
jhawthorn has joined #ruby
marahin has joined #ruby
heartburn has joined #ruby
mjacob has joined #ruby
rhe has joined #ruby
nemesit has joined #ruby
sam113101 has joined #ruby
m_antis has joined #ruby
hansolo has joined #ruby
victori has joined #ruby
ralu1 has joined #ruby
dza has joined #ruby
matoro has joined #ruby
keyvan has joined #ruby
jmcgnh has joined #ruby
FetidToot has joined #ruby
pvalenta has joined #ruby
lagash has joined #ruby
yossarian has joined #ruby
justache has joined #ruby
dostoyevsky2 has joined #ruby
benjaminwil has joined #ruby
repo has joined #ruby
andrea[m]1 has joined #ruby
wnd has joined #ruby
Sophira has joined #ruby
itok has joined #ruby
Neopolitan has joined #ruby
mbarbar has joined #ruby
meimei has joined #ruby
ikonia has joined #ruby
fcser has joined #ruby
taiju[m] has joined #ruby
JSharp has joined #ruby
Zerock has joined #ruby
rubin55 has joined #ruby
Exa has joined #ruby
conjunctive has joined #ruby
sphex has joined #ruby
Bi[m] has joined #ruby
Aminda has joined #ruby
splud has joined #ruby
dka_ has joined #ruby
polishdub has joined #ruby
c10l has joined #ruby
miah has joined #ruby
comeoooon has joined #ruby
sol has joined #ruby
oz has joined #ruby
peer has joined #ruby
bastelfreak has joined #ruby
Fridtjof has joined #ruby
slothby has joined #ruby
EdwardIII has joined #ruby
con3 has joined #ruby
moo has joined #ruby
asio has joined #ruby
Guest9768 has joined #ruby
yosafbridge has joined #ruby
cAMP has joined #ruby
kaleido has joined #ruby
cout has joined #ruby
hexology has joined #ruby
olspookishmagus has joined #ruby
jposer has joined #ruby
joenoon has joined #ruby
eof has joined #ruby
ccooke has joined #ruby
pjlsergeant has joined #ruby
clemens3 has joined #ruby
eldritch has joined #ruby
dannyAAM has joined #ruby
perrierjouet has joined #ruby
ringo__ has joined #ruby
egality has joined #ruby
ollysmith has joined #ruby
vito has joined #ruby
scottg489 has joined #ruby
Henry151 has joined #ruby
Byteflux has joined #ruby
dcx has joined #ruby
Hobbyboy has joined #ruby
georgemp has joined #ruby
A_Dragon has joined #ruby
r0bby has joined #ruby
niv has joined #ruby
John_Ivan has quit [Read error: Connection reset by peer]
basis2 has joined #ruby
Byteflux has quit [Max SendQ exceeded]
justache has quit [Max SendQ exceeded]
fredlinhares has quit [Read error: Connection reset by peer]
justache has joined #ruby
Byteflux has joined #ruby
John_Ivan has joined #ruby
<adam12>
sgt_chuckles: net/http is built-in. A lot of people use Faraday as well.
until1 has quit [Ping timeout: 268 seconds]
<adam12>
sgt_chuckles: There's a dozen+ HTTP clients for Ruby tho.
Bi[m] has quit [Ping timeout: 240 seconds]
andrea[m]1 has quit [Ping timeout: 264 seconds]
taiju[m] has quit [Ping timeout: 268 seconds]
sixecho has quit [Ping timeout: 255 seconds]
jhass[m] has quit [Ping timeout: 255 seconds]
_ht has quit [Quit: _ht]
fredlinhares has joined #ruby
basis2 has quit [Ping timeout: 268 seconds]
szkl has joined #ruby
sgt_chuckles has quit [Quit: Client closed]
jpn has joined #ruby
walez has joined #ruby
oxfuxxx has joined #ruby
jpn has quit [Ping timeout: 268 seconds]
artemis has joined #ruby
Viko has joined #ruby
fredlinhares has quit [Read error: Connection reset by peer]
oxfuxxx has quit [Ping timeout: 264 seconds]
fredlinhares has joined #ruby
Viko has quit [Quit: Viko]
artemis has quit [Ping timeout: 264 seconds]
fredlinhares has quit [Quit: WeeChat 3.6]
oxfuxxx has joined #ruby
conr has left #ruby [#ruby]
artemis has joined #ruby
oxfuxxx has quit [Ping timeout: 240 seconds]
taiju[m] has joined #ruby
ur5us has joined #ruby
jpn has joined #ruby
Shortstop has joined #ruby
<Shortstop>
does anyone here use Emacs with Ruby? Would need some help with my config
artemis has quit [Ping timeout: 252 seconds]
<Shortstop>
I'm getting this message when opening up a ruby file with Emacs despite having installed 'solargraph' with the 'gem install solargraph' gem:
<Shortstop>
LSP :: The following servers support current file but do not have automatic installation: ruby-ls sorbet-ls typeprof-ls steep-ls