Class: NSHTTPCookieWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/grope/web_resource_load_delegate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cookie) ⇒ NSHTTPCookieWrapper

Returns a new instance of NSHTTPCookieWrapper.



58
59
60
# File 'lib/grope/web_resource_load_delegate.rb', line 58

def initialize(cookie)
  @cookie = cookie
end

Instance Attribute Details

Returns the value of attribute cookie.



56
57
58
# File 'lib/grope/web_resource_load_delegate.rb', line 56

def cookie
  @cookie
end

Instance Method Details

#domainObject



62
63
64
# File 'lib/grope/web_resource_load_delegate.rb', line 62

def domain
  cookie.domain && cookie.domain.to_s
end

#expired?Boolean

Returns:

  • (Boolean)


82
83
84
# File 'lib/grope/web_resource_load_delegate.rb', line 82

def expired?
  cookie.expiresDate && Time.at(cookie.expiresDate.timeIntervalSince1970.to_i)
end

#nameObject



70
71
72
# File 'lib/grope/web_resource_load_delegate.rb', line 70

def name
  cookie.name.to_s
end

#pathObject



66
67
68
# File 'lib/grope/web_resource_load_delegate.rb', line 66

def path
  cookie.path && cookie.path.to_s
end

#secureObject



78
79
80
# File 'lib/grope/web_resource_load_delegate.rb', line 78

def secure
  cookie.isSecure == true.to_ns ? true : false
end

#valueObject



74
75
76
# File 'lib/grope/web_resource_load_delegate.rb', line 74

def value
  cookie.value
end