Class: RSAC::LexicalURI

Inherits:
LexicalUnit show all
Defined in:
lib/antisamy/csspool/rsac/sac/lexical_unit.rb

Instance Attribute Summary

Attributes inherited from LexicalUnit

#dimension_unit_text, #float_value, #function_name, #integer_value, #lexical_unit_type, #parameters, #string_value

Instance Method Summary collapse

Methods inherited from LexicalUnit

#eql?

Constructor Details

#initialize(value) ⇒ LexicalURI

Returns a new instance of LexicalURI.



113
114
115
116
# File 'lib/antisamy/csspool/rsac/sac/lexical_unit.rb', line 113

def initialize(value)
  self.string_value = value.gsub(/^url\(/, '').gsub(/\)$/, '')
  self.lexical_unit_type = :SAC_URI
end

Instance Method Details

#==(other) ⇒ Object



118
119
120
# File 'lib/antisamy/csspool/rsac/sac/lexical_unit.rb', line 118

def ==(other)
  super && self.string_value == other.string_value
end

#hashObject



122
123
124
# File 'lib/antisamy/csspool/rsac/sac/lexical_unit.rb', line 122

def hash
  self.string_value.hash
end

#to_sObject



126
127
128
# File 'lib/antisamy/csspool/rsac/sac/lexical_unit.rb', line 126

def to_s
  "url(#{string_value})"
end