module Locomotive::Steam::Adapters::Filesystem::Sanitizer

Attributes

scope[R]

Public Instance Methods

apply_to(entity_or_dataset) click to toggle source
# File lib/locomotive/steam/adapters/filesystem/sanitizer.rb, line 23
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
apply_to_dataset(dataset) click to toggle source
# File lib/locomotive/steam/adapters/filesystem/sanitizer.rb, line 31
def apply_to_dataset(dataset)
  dataset
end
apply_to_entity(entity) click to toggle source
# File lib/locomotive/steam/adapters/filesystem/sanitizer.rb, line 35
def apply_to_entity(entity)
  attach_site_to(entity)
  entity
end
apply_to_entity_with_dataset(entity, dataset) click to toggle source
# File lib/locomotive/steam/adapters/filesystem/sanitizer.rb, line 40
def apply_to_entity_with_dataset(entity, dataset)
  entity
end
attach_site_to(entity) click to toggle source
# File lib/locomotive/steam/adapters/filesystem/sanitizer.rb, line 44
def attach_site_to(entity)
  entity[:site_id] = scope.site._id if scope.site
end
setup(scope) click to toggle source
# File lib/locomotive/steam/adapters/filesystem/sanitizer.rb, line 13
def setup(scope)
  @scope = scope
  self
end
with(scope) { |self| ... } click to toggle source
# File lib/locomotive/steam/adapters/filesystem/sanitizer.rb, line 18
def with(scope, &block)
  setup(scope)
  yield(self)
end