Class: RSAC::Conditions::ClassCondition

Inherits:
AttributeCondition show all
Defined in:
lib/antisamy/csspool/rsac/sac/conditions/class_condition.rb

Instance Attribute Summary

Attributes inherited from AttributeCondition

#local_name, #specified, #value

Attributes inherited from Condition

#condition_type

Instance Method Summary collapse

Methods inherited from AttributeCondition

#==, build, #hash, #specificity

Methods inherited from Condition

#==, #eql?, #hash

Constructor Details

#initialize(klass) ⇒ ClassCondition

Returns a new instance of ClassCondition.



5
6
7
# File 'lib/antisamy/csspool/rsac/sac/conditions/class_condition.rb', line 5

def initialize(klass)
  super("class", klass, true, :SAC_CLASS_CONDITION)
end

Instance Method Details

#to_cssObject



9
10
11
# File 'lib/antisamy/csspool/rsac/sac/conditions/class_condition.rb', line 9

def to_css
  ".#{value}"
end

#to_xpathObject



13
14
15
# File 'lib/antisamy/csspool/rsac/sac/conditions/class_condition.rb', line 13

def to_xpath
  "[contains(@#{local_name}, '#{value}')]"
end