Class: AntiSamy::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/antisamy/model/attribute.rb

Overview

A model for HTML attributes and the “rules” they must follow (either literals or regular expressions) in order to be considered valid. This is a simple container class

Constant Summary collapse

ACTION_REMOVE_TAG =
"removeTag"
ACTION_FILTER_TAG =
"filterTag"
ACTION_ENCODE_TAG =
"encodeTag"
ACTION_REMOVE_ATTRIB =
"removeAttribute"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Attribute

Create a new attribute



11
12
13
14
15
16
17
# File 'lib/antisamy/model/attribute.rb', line 11

def initialize(name)
  @name = name
  @description = nil
  @action = nil
  @values = []
  @expressions = []
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



5
6
7
# File 'lib/antisamy/model/attribute.rb', line 5

def action
  @action
end

#descriptionObject

Returns the value of attribute description.



5
6
7
# File 'lib/antisamy/model/attribute.rb', line 5

def description
  @description
end

#expressionsObject

Returns the value of attribute expressions.



5
6
7
# File 'lib/antisamy/model/attribute.rb', line 5

def expressions
  @expressions
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/antisamy/model/attribute.rb', line 5

def name
  @name
end

#valuesObject

Returns the value of attribute values.



5
6
7
# File 'lib/antisamy/model/attribute.rb', line 5

def values
  @values
end