class Dao::Gateway::ScopeTransformer

Attributes

associations[RW]
entity[R]
pipe[R]

Public Class Methods

new(entity) click to toggle source
# File lib/dao/gateway/scope_transformer.rb, line 8
def initialize(entity)
  @associations = []
  @entity = entity

  @pipe = Pipe.new
  @pipe.postprocess(Dao::Gateway::EntityProcessor.new(entity))

  add_processors
end

Public Instance Methods

export_attributes_black_list() click to toggle source
# File lib/dao/gateway/scope_transformer.rb, line 30
def export_attributes_black_list
  []
end
many(relation) click to toggle source
# File lib/dao/gateway/scope_transformer.rb, line 18
def many(relation)
  transform(relation)
end
one(relation) click to toggle source
# File lib/dao/gateway/scope_transformer.rb, line 22
def one(relation)
  transform(Array(relation)).first
end
other(relation) click to toggle source
# File lib/dao/gateway/scope_transformer.rb, line 26
def other(relation)
  relation
end

Protected Instance Methods

add_processors() click to toggle source
# File lib/dao/gateway/scope_transformer.rb, line 40
def add_processors

end
transform(relation) click to toggle source
# File lib/dao/gateway/scope_transformer.rb, line 36
def transform(relation)
  Iterator.new(relation, pipe, @associations)
end