class Trailblazer::Context::Container

Public Class Methods

new(wrapped_options, mutable_options, replica_class:, aliases: nil, **) click to toggle source
# File lib/trailblazer/context/container.rb, line 14
def initialize(wrapped_options, mutable_options, replica_class:, aliases: nil, **)
  raise UseWithAliases if aliases

  @wrapped_options  = wrapped_options
  @mutable_options  = mutable_options
  @replica_class    = replica_class

  @replica = initialize_replica_store
end

Public Instance Methods

decompose() click to toggle source

Return the Context's two components. Used when computing the new output for the next activity.

# File lib/trailblazer/context/container.rb, line 26
def decompose
  [@wrapped_options, @mutable_options]
end
inspect() click to toggle source
# File lib/trailblazer/context/container.rb, line 30
def inspect
  %{#<Trailblazer::Context::Container wrapped_options=#{@wrapped_options} mutable_options=#{@mutable_options}>}
end
Also aliased as: to_s
to_s()
Alias for: inspect

Private Instance Methods

initialize_replica_store() click to toggle source
# File lib/trailblazer/context/container.rb, line 35
        def initialize_replica_store
  @replica_class.new([ @wrapped_options, @mutable_options ])
end