private Method

Tag.match_condition(value, condition)

Match the given value to the given condition.

Source Code

# File action_controller/vendor/html-scanner/html/node.rb, line 513
def match_condition(value, condition)
  case condition
    when String
      value && value == condition
    when Regexp
      value && value.match(condition)
    when Numeric
      value == condition.to_s
    when true
      !value.nil?
    when false, nil
      value.nil?
    else
      false
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.