Class: K3CloudWebapiSdk::Model::Cookie

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: '', value: '', domain: '', path: '/', expires: nil, http_only: false, secure: false) ⇒ Cookie

Returns a new instance of Cookie.



6
7
8
9
10
11
12
13
14
# File 'lib/k3cloud_webapi_sdk/model/cookie.rb', line 6

def initialize(name: '', value: '', domain: '', path: '/', expires: nil, http_only: false, secure: false)
  @name = name
  @value = value
  @domain = domain
  @path = path
  @expires = expires
  @http_only = http_only
  @secure = secure
end

Instance Attribute Details

#domainObject

Returns the value of attribute domain.



4
5
6
# File 'lib/k3cloud_webapi_sdk/model/cookie.rb', line 4

def domain
  @domain
end

#expiresObject

Returns the value of attribute expires.



4
5
6
# File 'lib/k3cloud_webapi_sdk/model/cookie.rb', line 4

def expires
  @expires
end

#http_onlyObject

Returns the value of attribute http_only.



4
5
6
# File 'lib/k3cloud_webapi_sdk/model/cookie.rb', line 4

def http_only
  @http_only
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/k3cloud_webapi_sdk/model/cookie.rb', line 4

def name
  @name
end

#pathObject

Returns the value of attribute path.



4
5
6
# File 'lib/k3cloud_webapi_sdk/model/cookie.rb', line 4

def path
  @path
end

#secureObject

Returns the value of attribute secure.



4
5
6
# File 'lib/k3cloud_webapi_sdk/model/cookie.rb', line 4

def secure
  @secure
end

#valueObject

Returns the value of attribute value.



4
5
6
# File 'lib/k3cloud_webapi_sdk/model/cookie.rb', line 4

def value
  @value
end

Instance Method Details

#to_hObject



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/k3cloud_webapi_sdk/model/cookie.rb', line 20

def to_h
  {
    name: @name,
    value: @value,
    domain: @domain,
    path: @path,
    expires: @expires,
    http_only: @http_only,
    secure: @secure
  }
end

#to_sObject



16
17
18
# File 'lib/k3cloud_webapi_sdk/model/cookie.rb', line 16

def to_s
  "#{@name}=#{@value}"
end