Class: RSAC::Conditions::IDCondition
Instance Attribute Summary
#local_name, #specified, #value
Attributes inherited from Condition
#condition_type
Instance Method Summary
collapse
#==, build, #hash
Methods inherited from Condition
#==, #eql?, #hash
Constructor Details
Returns a new instance of IDCondition.
5
6
7
8
|
# File 'lib/antisamy/csspool/rsac/sac/conditions/id_condition.rb', line 5
def initialize(id)
id = id[1..id.size] if id[0] == ?#
super("id", id, true, :SAC_ID_CONDITION)
end
|
Instance Method Details
#specificity ⇒ Object
18
19
20
|
# File 'lib/antisamy/csspool/rsac/sac/conditions/id_condition.rb', line 18
def specificity
[0, 1, 0, 0]
end
|
#to_css ⇒ Object
10
11
12
|
# File 'lib/antisamy/csspool/rsac/sac/conditions/id_condition.rb', line 10
def to_css
"##{value}"
end
|
#to_xpath ⇒ Object
14
15
16
|
# File 'lib/antisamy/csspool/rsac/sac/conditions/id_condition.rb', line 14
def to_xpath
"[@id='#{value}']"
end
|