Sha256: aa0d8b0992c5c1334fa33ecc5e81358d4daccd6750bc985a73cc083af8752454
Contents?: true
Size: 1.02 KB
Versions: 53
Compression:
Stored size: 1.02 KB
Contents
module Locomotive::Steam module Adapters module Filesystem module Sanitizer extend Forwardable def_delegators :@scope, :site, :locale, :locales, :default_locale attr_reader :scope def setup(scope) @scope = scope self end def with(scope, &block) setup(scope) yield(self) end def apply_to(entity_or_dataset) if entity_or_dataset.respond_to?(:all) apply_to_dataset(entity_or_dataset) else apply_to_entity(entity_or_dataset) end end def apply_to_dataset(dataset) dataset end def apply_to_entity(entity) attach_site_to(entity) entity end def apply_to_entity_with_dataset(entity, dataset) entity end def attach_site_to(entity) entity[:site_id] = scope.site._id if scope.site end alias :current_locale :locale end end end end
Version data entries
53 entries across 53 versions & 1 rubygems