123456789_123456789_123456789_123456789_123456789_

Class: ActionCable::Connection::TestCookieJar

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: ActiveSupport::HashWithIndifferentAccess
Defined in: actioncable/lib/action_cable/connection/test_case.rb

Overview

We don’t want to use the whole “encryption stack” for connection unit-tests, but we want to make sure that users test against the correct types of cookies (i.e. signed or encrypted or plain)

Class Method Summary

::ActiveSupport::HashWithIndifferentAccess - Inherited

::Hash - Inherited

.from_trusted_xml

Builds a ::Hash from XML just like Hash.from_xml, but also allows ::Symbol and YAML.

.from_xml

Returns a ::Hash containing a collection of pairs when the key is the node name and the value is its content.

Instance Attribute Summary

::ActiveSupport::HashWithIndifferentAccess - Inherited

#extractable_options?

Returns true so that Array#extract_options! finds members of this class.

::Hash - Inherited

#extractable_options?

By default, only instances of ::Hash itself are extractable.

Instance Method Summary

::ActiveSupport::HashWithIndifferentAccess - Inherited

#[]

Same as Hash#[] where the key passed as argument can be either a string or a symbol:

#[]=

Assigns a new value to the hash:

#assoc

Same as Hash#assoc where the key passed as argument can be either a string or a symbol:

#compact, #deep_stringify_keys, #deep_stringify_keys!, #deep_symbolize_keys,
#default

Same as Hash#default where the key passed as argument can be either a string or a symbol:

#delete

Removes the specified key from the hash.

#dig

Same as Hash#dig where the key passed as argument can be either a string or a symbol:

#dup

Returns a shallow copy of the hash.

#except

Returns a hash with indifferent access that includes everything except given keys.

#fetch

Same as Hash#fetch where the key passed as argument can be either a string or a symbol:

#fetch_values

Returns an array of the values at the specified indices, but also raises an exception when one of the keys can’t be found.

#has_key?
#include?
#key?

Checks the hash for a key matching the argument passed in:

#member?
#merge

This method has the same semantics of update, except it does not modify the receiver but rather returns a new hash with indifferent access with the result of the merge.

#merge!
#nested_under_indifferent_access, #regular_update, #regular_writer, #reject,
#replace

Replaces the contents of this hash with other_hash.

#reverse_merge

Like merge but the other way around: Merges the receiver into the argument and returns a new hash with indifferent access as result:

#reverse_merge!

Same semantics as reverse_merge but modifies the receiver in-place.

#select, #slice, #slice!,
#store
#stringify_keys, #stringify_keys!, #symbolize_keys,
#to_hash

Convert to a regular hash with string keys.

#to_options
#to_options!, #transform_keys, #transform_keys!, #transform_values,
#update

Updates the receiver in-place, merging in the hashes passed as arguments:

#values_at

Returns an array of the values at the specified indices:

#with_defaults
#with_defaults!
#with_indifferent_access,
#without

::Hash - Inherited

#assert_valid_keys

Validates all keys in a hash match *valid_keys, raising ArgumentError on a mismatch.

#blank?

A hash is blank if it’s empty:

#compact_blank!

Removes all blank values from the ::Hash in place and returns self.

#deep_dup

Returns a deep copy of hash.

#deep_merge

Returns a new hash with self and other_hash merged recursively.

#deep_merge!

Same as deep_merge, but modifies self.

#deep_stringify_keys

Returns a new hash with all keys converted to strings.

#deep_stringify_keys!

Destructively converts all keys to strings.

#deep_symbolize_keys

Returns a new hash with all keys converted to symbols, as long as they respond to to_sym.

#deep_symbolize_keys!

Destructively converts all keys to symbols, as long as they respond to to_sym.

#deep_transform_keys

Returns a new hash with all keys converted by the block operation.

#deep_transform_keys!

Destructively converts all keys by using the block operation.

#deep_transform_values

Returns a new hash with all values converted by the block operation.

#deep_transform_values!

Destructively converts all values by using the block operation.

#except

Returns a hash that includes everything except given keys.

#except!

Removes the given keys from hash and returns it.

#extract!

Removes and returns the key/value pairs matching the given keys.

#nested_under_indifferent_access
#reverse_merge

Merges the caller into other_hash.

#reverse_merge!

Destructive reverse_merge.

#reverse_update
#slice!

Replaces the hash with only the given keys.

#stringify_keys

Returns a new hash with all keys converted to strings.

#stringify_keys!

Destructively converts all keys to strings.

#symbolize_keys

Returns a new hash with all keys converted to symbols, as long as they respond to to_sym.

#symbolize_keys!

Destructively converts all keys to symbols, as long as they respond to to_sym.

#to_options
#to_options!
#to_param

Alias for Hash#to_query.

#to_query

Returns a string representation of the receiver suitable for use as a URL query string:

#to_xml

Returns a string containing an XML representation of its receiver:

#with_defaults
#with_defaults!
#with_indifferent_access

Returns an ::ActiveSupport::HashWithIndifferentAccess out of its receiver:

Constructor Details

This class inherits a constructor from ActiveSupport::HashWithIndifferentAccess

Instance Method Details

#encrypted

[ GitHub ]

  
# File 'actioncable/lib/action_cable/connection/test_case.rb', line 38

def encrypted
  self[:encrypted] ||= {}.with_indifferent_access
end

#signed

[ GitHub ]

  
# File 'actioncable/lib/action_cable/connection/test_case.rb', line 34

def signed
  self[:signed] ||= {}.with_indifferent_access
end