Do not try to typecast values with ERB

not all JSON backends will accept Strings with ERB while dumping
fixes:
- https://bugzilla.redhat.com/show_bug.cgi?id=1117178
- https://bugzilla.redhat.com/show_bug.cgi?id=1117346
- https://bugzilla.redhat.com/show_bug.cgi?id=1116966
could you please use ternary if operator instead of calling tap on if/end?
also has_erb? could by DRYed up a bit (it's also in tap block)