Add support method_name for amo_property option#47
Conversation
palkan
left a comment
There was a problem hiding this comment.
property in code above is in uppercase. To make this works i added downcase:
I think it's better to handle this case in the Property class, 'cause that's where we know
that names are downcased:
amorail/lib/amorail/property.rb
Line 32 in aa01184
We can add downcase here:
amorail/lib/amorail/property.rb
Line 7 in aa01184
Co-Authored-By: Vladimir Dementyev <dementiev.vm@gmail.com>
|
@palkan Thank you for the quick reaction. |
lib/amorail/property.rb
Outdated
|
|
||
| def respond_to_missing?(method_sym, *args) | ||
| args.size.zero? && data.key?(method_sym.to_s) | ||
| args.size.zero? && data.key?(prep_method_name(method_sym)) |
There was a problem hiding this comment.
@palkan Please take a look at this. I understand that is standard case usind respond_to missing?, but I could make mistake because I have little experience in ruby/ror.
There was a problem hiding this comment.
Yeah, that looks good.
Only one suggestion: let's not extract to_s.downcase to a prep_method_name to avoid adding one more method to the module. It's OK to duplicate here.
|
Released in 0.6.1. |
Due to issue: #39
and thanks to: https://github.com/foxford/amorail/commit/3404da937661230ccc7c9f23f138cdacd65dc477
This will help to do things this way:
Warning: property in code above is in uppercase. To make this works i added downcase:
I hope this change does not cause problems. Otherwise getting an error: