Class: Http2::Cookie

Inherits:
Object
  • Object
show all
Defined in:
lib/http2/cookie.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Cookie

Returns a new instance of Cookie.



4
5
6
7
8
9
# File 'lib/http2/cookie.rb', line 4

def initialize(args)
  @name = args[:name]
  @value = args[:value]
  @path = args[:path]
  @expires_raw = args[:expires]
end

Instance Attribute Details

#expires_rawObject (readonly)

Returns the value of attribute expires_raw.



2
3
4
# File 'lib/http2/cookie.rb', line 2

def expires_raw
  @expires_raw
end

#nameObject (readonly)

Returns the value of attribute name.



2
3
4
# File 'lib/http2/cookie.rb', line 2

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



2
3
4
# File 'lib/http2/cookie.rb', line 2

def path
  @path
end

#valueObject (readonly)

Returns the value of attribute value.



2
3
4
# File 'lib/http2/cookie.rb', line 2

def value
  @value
end

Instance Method Details

#expiresObject



19
20
21
# File 'lib/http2/cookie.rb', line 19

def expires
  @expires ||= Time.parse(@expires_raw) if @expires_raw
end

#inspectObject



11
12
13
# File 'lib/http2/cookie.rb', line 11

def inspect
  "#<Http2::Cookie name=#{@name} value=#{@value} path=#{@path}>"
end

#to_sObject



15
16
17
# File 'lib/http2/cookie.rb', line 15

def to_s
  inspect
end