lib/fixtury/store.rb in fixtury-0.2.1 vs lib/fixtury/store.rb in fixtury-0.3.0.beta

- old
+ new

@@ -19,29 +19,26 @@ cattr_accessor :instance attr_reader :filepath, :references, :ttl, :auto_refresh_expired attr_reader :schema, :locator attr_reader :log_level - attr_reader :execution_context def initialize( filepath: nil, locator: ::Fixtury::Locator.instance, log_level: nil, ttl: nil, schema: nil, - execution_context: nil, auto_refresh_expired: false ) @schema = schema || ::Fixtury.schema @log_level = log_level.nil? ? ENV["FIXTURY_LOG_LEVEL"] : log_level @log_level ||= LOG_LEVEL_NONE @log_level = @log_level.to_s.to_sym @locator = locator @filepath = filepath @references = @filepath && ::File.file?(@filepath) ? ::YAML.load_file(@filepath) : {} - @execution_context = execution_context @ttl = ttl ? ttl.to_i : ttl @auto_refresh_expired = !!auto_refresh_expired self.class.instance ||= self end @@ -105,10 +102,10 @@ result = ref&.real? log(level: LOG_LEVEL_DEBUG) { result ? "hit #{full_name}" : "miss #{full_name}" } result end - def get(name) + def get(name, execution_context: nil) dfn = schema.get_definition!(name) full_name = dfn.name ref = references[full_name] if ref&.holder?