Class: RSAC::Selectors::Selector

Inherits:
Object
  • Object
show all
Defined in:
lib/antisamy/csspool/rsac/sac/selectors/selector.rb

Direct Known Subclasses

SimpleSelector

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(selector_type) ⇒ Selector

Returns a new instance of Selector.



7
8
9
# File 'lib/antisamy/csspool/rsac/sac/selectors/selector.rb', line 7

def initialize(selector_type)
  @selector_type = selector_type
end

Instance Attribute Details

#selector_typeObject (readonly)

Returns the value of attribute selector_type.



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

def selector_type
  @selector_type
end

Instance Method Details

#==(other) ⇒ Object



11
12
13
# File 'lib/antisamy/csspool/rsac/sac/selectors/selector.rb', line 11

def ==(other)
  self.class === other && selector_type == other.selector_type
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/antisamy/csspool/rsac/sac/selectors/selector.rb', line 19

def eql?(other)
  self == other
end

#hashObject



15
16
17
# File 'lib/antisamy/csspool/rsac/sac/selectors/selector.rb', line 15

def hash
  selector_type.hash
end