Class: SiteHub::Cookie::Attribute

Inherits:
Object
  • Object
show all
Includes:
Equality
Defined in:
lib/sitehub/cookie/attribute.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Equality

#==, #_clazz, included

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

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/sitehub/cookie/attribute.rb', line 7

def name
  @name
end

#valueObject (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_sObject



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