Class: AntiSamy::CssProperty
- Inherits:
-
Object
- Object
- AntiSamy::CssProperty
- Defined in:
- lib/antisamy/model/css_property.rb
Overview
A model for CSS properties and the “rules” they must follow (either literals or regular expressions) in order to be considered valid.
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#catagories ⇒ Object
Returns the value of attribute catagories.
-
#description ⇒ Object
Returns the value of attribute description.
-
#expressions ⇒ Object
Returns the value of attribute expressions.
-
#name ⇒ Object
Returns the value of attribute name.
-
#refs ⇒ Object
Returns the value of attribute refs.
-
#values ⇒ Object
Returns the value of attribute values.
Instance Method Summary collapse
-
#add_category(cat) ⇒ Object
Add a category to this property.
-
#add_expression(exp) ⇒ Object
Add a regular expression to this property.
-
#add_ref(ref) ⇒ Object
Add a shorthand reference to this property.
-
#add_value(value) ⇒ Object
Add a literal value to this property.
-
#initialize(name) ⇒ CssProperty
constructor
Create a new property.
Constructor Details
#initialize(name) ⇒ CssProperty
Create a new property
8 9 10 11 12 13 14 15 16 |
# File 'lib/antisamy/model/css_property.rb', line 8 def initialize(name) @name = name @description = nil @values = [] @expressions = [] @refs = [] @categories = [] @action = nil end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
5 6 7 |
# File 'lib/antisamy/model/css_property.rb', line 5 def action @action end |
#catagories ⇒ Object
Returns the value of attribute catagories.
5 6 7 |
# File 'lib/antisamy/model/css_property.rb', line 5 def catagories @catagories end |
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/antisamy/model/css_property.rb', line 5 def description @description end |
#expressions ⇒ Object
Returns the value of attribute expressions.
5 6 7 |
# File 'lib/antisamy/model/css_property.rb', line 5 def expressions @expressions end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/antisamy/model/css_property.rb', line 5 def name @name end |
#refs ⇒ Object
Returns the value of attribute refs.
5 6 7 |
# File 'lib/antisamy/model/css_property.rb', line 5 def refs @refs end |
#values ⇒ Object
Returns the value of attribute values.
5 6 7 |
# File 'lib/antisamy/model/css_property.rb', line 5 def values @values end |
Instance Method Details
#add_category(cat) ⇒ Object
Add a category to this property
34 35 36 |
# File 'lib/antisamy/model/css_property.rb', line 34 def add_category(cat) @categories << cat end |
#add_expression(exp) ⇒ Object
Add a regular expression to this property
24 25 26 |
# File 'lib/antisamy/model/css_property.rb', line 24 def add_expression(exp) @expressions << exp end |
#add_ref(ref) ⇒ Object
Add a shorthand reference to this property
29 30 31 |
# File 'lib/antisamy/model/css_property.rb', line 29 def add_ref(ref) @refs << ref end |
#add_value(value) ⇒ Object
Add a literal value to this property
19 20 21 |
# File 'lib/antisamy/model/css_property.rb', line 19 def add_value(value) @values << value end |