Class: SiteHub::Cookie::Attribute
- Inherits:
-
Object
- Object
- SiteHub::Cookie::Attribute
- Includes:
- Equality
- Defined in:
- lib/sitehub/cookie/attribute.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name, value) ⇒ Attribute
constructor
A new instance of Attribute.
- #to_s ⇒ Object
- #update(value) ⇒ Object
Methods included from Equality
Constructor Details
#initialize(name, value) ⇒ Attribute
Returns a new instance of Attribute.
9 10 11 12 |
# File 'lib/sitehub/cookie/attribute.rb', line 9 def initialize(name, value) @name = StringUtils.sanitise(name).to_sym @value = StringUtils.sanitise(value) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/sitehub/cookie/attribute.rb', line 7 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/sitehub/cookie/attribute.rb', line 7 def value @value end |
Instance Method Details
#to_s ⇒ Object
18 19 20 |
# File 'lib/sitehub/cookie/attribute.rb', line 18 def to_s "#{name}=#{value}" end |
#update(value) ⇒ Object
14 15 16 |
# File 'lib/sitehub/cookie/attribute.rb', line 14 def update(value) @value = value end |