module Trailblazer::Context::Container::CommonMethods
Some common methods made available directly in Context::Container
for performance tuning, extensions and to avoid `@replica` delegations.
Public Instance Methods
[](key)
click to toggle source
# File lib/trailblazer/context/container.rb, line 42 def [](key) @replica[key] end
[]=(key, value)
click to toggle source
# File lib/trailblazer/context/container.rb, line 46 def []=(key, value) @replica[key] = value @mutable_options[key] = value end
Also aliased as: store
delete(key)
click to toggle source
# File lib/trailblazer/context/container.rb, line 52 def delete(key) @replica.delete(key) @mutable_options.delete(key) end
each(&block)
click to toggle source
# File lib/trailblazer/context/container.rb, line 79 def each(&block); @replica.each(&block); end
fetch(key, default = nil, &block)
click to toggle source
# File lib/trailblazer/context/container.rb, line 65 def fetch(key, default = nil, &block) @replica.fetch(key, default, &block) end
key?(key)
click to toggle source
# File lib/trailblazer/context/container.rb, line 71 def key?(key); @replica.key?(key); end
keys()
click to toggle source
# File lib/trailblazer/context/container.rb, line 69 def keys; @replica.keys; end
merge(other_hash)
click to toggle source
# File lib/trailblazer/context/container.rb, line 57 def merge(other_hash) self.class.new( @wrapped_options, @mutable_options.merge(other_hash), replica_class: @replica_class, ) end
to_hash()
click to toggle source
# File lib/trailblazer/context/container.rb, line 77 def to_hash; @replica.to_hash; end
value?(value)
click to toggle source
# File lib/trailblazer/context/container.rb, line 75 def value?(value); @replica.value?(value); end
values()
click to toggle source
# File lib/trailblazer/context/container.rb, line 73 def values; @replica.values; end