module Trailblazer

TODO: mark/make all but mutable_options as frozen. The idea of Context is to have a generic, ordered read/write interface that collects mutable runtime-computed data while providing access to compile-time information. The runtime-data takes precedence over the class data.

Public Class Methods

Context(wrapped_options, mutable_options = {}, context_options = nil) click to toggle source
# File lib/trailblazer/context.rb, line 29
def self.Context(wrapped_options, mutable_options = {}, context_options = nil)
  defaults = { container_class: Context::Container, replica_class: Context::Store::IndifferentAccess }
  Context.build(wrapped_options, mutable_options, **defaults.merge( Hash(context_options) ))
end