There's a builtin method on Object for this type of comparison: 
```ruby
return '' unless @args[:ipath].kind_of?(String)
```
kind_of? and is_a? both work.