Class: RSAC::Conditions::ClassCondition
- Inherits:
-
AttributeCondition
- Object
- Condition
- AttributeCondition
- RSAC::Conditions::ClassCondition
- 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
Instance Method Summary collapse
-
#initialize(klass) ⇒ ClassCondition
constructor
A new instance of ClassCondition.
- #to_css ⇒ Object
- #to_xpath ⇒ Object
Methods inherited from AttributeCondition
#==, build, #hash, #specificity
Methods inherited from Condition
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_css ⇒ Object
9 10 11 |
# File 'lib/antisamy/csspool/rsac/sac/conditions/class_condition.rb', line 9 def to_css ".#{value}" end |
#to_xpath ⇒ Object
13 14 15 |
# File 'lib/antisamy/csspool/rsac/sac/conditions/class_condition.rb', line 13 def to_xpath "[contains(@#{local_name}, '#{value}')]" end |