Class: Rack::MockResponse::Cookie

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/mock_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Cookie

Returns a new instance of Cookie.



17
18
19
20
21
22
23
24
# File 'lib/rack/mock_response.rb', line 17

def initialize(args)
  @name = args["name"]
  @value = args["value"]
  @path = args["path"]
  @domain = args["domain"]
  @expires = args["expires"]
  @secure = args["secure"]
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object



26
27
28
# File 'lib/rack/mock_response.rb', line 26

def method_missing(method_name, *args, &block)
  @value.send(method_name, *args, &block)
end

Instance Attribute Details

#domainObject (readonly)

Returns the value of attribute domain.



15
16
17
# File 'lib/rack/mock_response.rb', line 15

def domain
  @domain
end

#expiresObject (readonly)

Returns the value of attribute expires.



15
16
17
# File 'lib/rack/mock_response.rb', line 15

def expires
  @expires
end

#nameObject (readonly)

Returns the value of attribute name.



15
16
17
# File 'lib/rack/mock_response.rb', line 15

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



15
16
17
# File 'lib/rack/mock_response.rb', line 15

def path
  @path
end

#secureObject (readonly)

Returns the value of attribute secure.



15
16
17
# File 'lib/rack/mock_response.rb', line 15

def secure
  @secure
end

#valueObject (readonly)

Returns the value of attribute value.



15
16
17
# File 'lib/rack/mock_response.rb', line 15

def value
  @value
end

Instance Method Details

#respond_to_missing?(method_name, include_all = false) ⇒ Boolean

:nocov:

Returns:

  • (Boolean)


33
34
35
# File 'lib/rack/mock_response.rb', line 33

def respond_to_missing?(method_name, include_all = false)
  @value.respond_to?(method_name, include_all) || super
end