Class: RSAC::Conditions::Condition

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

Direct Known Subclasses

AttributeCondition, CombinatorCondition

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(condition_type) ⇒ Condition

Returns a new instance of Condition.



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

def initialize(condition_type)
  @condition_type = condition_type
end

Instance Attribute Details

#condition_typeObject

Returns the value of attribute condition_type.



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

def condition_type
  @condition_type
end

Instance Method Details

#==(other) ⇒ Object



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

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

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


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

def eql?(other)
  self == other
end

#hashObject



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

def hash
  condition_type.hash
end

#to_cssObject



23
24
25
# File 'lib/antisamy/csspool/rsac/sac/conditions/condition.rb', line 23

def to_css
  nil
end