Skip to content

.blank? requires rails #2

Description

@clarkewd

It seems that using .blank? On line 26 causes an error unless using this inside a rails app:

NoMethodError: undefined method `blank?' for "dedicated.server.com":String
from ~/.rvm/gems/ruby-1.9.3-p547/gems/whm_xml-0.3.2/lib/parameters.rb:26:in `block in requires!'

Perhaps don't use .blank? is the best option. Also I saw someone use a monkeypatch to fix something similar but it's probably not good practice:

unless Object.new.respond_to? :blank?
    class Object
        def blank?
            respond_to?(:empty?) ? empty? : !self
        end
    end
end

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions