Class: RSAC::Conditions::BeginHyphenCondition

Inherits:
AttributeCondition show all
Defined in:
lib/antisamy/csspool/rsac/sac/conditions/begin_hyphen_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(local_name, value) ⇒ BeginHyphenCondition

Returns a new instance of BeginHyphenCondition.



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

def initialize(local_name, value)
  super(local_name, value, true, :SAC_BEGIN_HYPHEN_ATTRIBUTE_CONDITION)
end

Instance Method Details

#to_cssObject



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

def to_css
  "[#{local_name}|=#{value}]"
end

#to_xpathObject



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

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