Class: Rack::MockResponse::Cookie

Inherits:
Object
  • Object
show all
Defined in:
vendor/bundler/ruby/3.4.0/bundler/gems/rack-40d68f842b5f/lib/rack/mock_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Cookie

Returns a new instance of Cookie.



16
17
18
19
20
21
22
23
# File 'vendor/bundler/ruby/3.4.0/bundler/gems/rack-40d68f842b5f/lib/rack/mock_response.rb', line 16

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



25
26
27
# File 'vendor/bundler/ruby/3.4.0/bundler/gems/rack-40d68f842b5f/lib/rack/mock_response.rb', line 25

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.



14
15
16
# File 'vendor/bundler/ruby/3.4.0/bundler/gems/rack-40d68f842b5f/lib/rack/mock_response.rb', line 14

def domain
  @domain
end

#expiresObject (readonly)

Returns the value of attribute expires.



14
15
16
# File 'vendor/bundler/ruby/3.4.0/bundler/gems/rack-40d68f842b5f/lib/rack/mock_response.rb', line 14

def expires
  @expires
end

#nameObject (readonly)

Returns the value of attribute name.



14
15
16
# File 'vendor/bundler/ruby/3.4.0/bundler/gems/rack-40d68f842b5f/lib/rack/mock_response.rb', line 14

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



14
15
16
# File 'vendor/bundler/ruby/3.4.0/bundler/gems/rack-40d68f842b5f/lib/rack/mock_response.rb', line 14

def path
  @path
end

#secureObject (readonly)

Returns the value of attribute secure.



14
15
16
# File 'vendor/bundler/ruby/3.4.0/bundler/gems/rack-40d68f842b5f/lib/rack/mock_response.rb', line 14

def secure
  @secure
end

#valueObject (readonly)

Returns the value of attribute value.



14
15
16
# File 'vendor/bundler/ruby/3.4.0/bundler/gems/rack-40d68f842b5f/lib/rack/mock_response.rb', line 14

def value
  @value
end

Instance Method Details

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

:nocov:

Returns:

  • (Boolean)


32
33
34
# File 'vendor/bundler/ruby/3.4.0/bundler/gems/rack-40d68f842b5f/lib/rack/mock_response.rb', line 32

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