mailjet / mailjet-gem

[API v3] Mailjet official Ruby GEM

Home Page:https://dev.mailjet.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

weird behavior for methods ending with question marks

MathieuDerelle opened this issue · comments

for boolean values it make sense to define those methods :

x = Mailjet::Contact.first
x.persisted?
# => true

but it works for every type of attributes and seems weird

x.created_at?
# => Wed, 18 Jul 2018 13:29:29 +0000
x.name?
# => "Mat"

even more for undefined attributes

x.dsfdqfds
# => NoMethodError: undefined method `dsfdqfds' for #<Mailjet::Contact:0x007fdc7da95ec8>
x.dsfdqfds?
# => nil
# should raise "undefined method" too ?

compared to

x.name
# => "Mat"
x.name?
# => "Mat"

Fixed in v1.6.0