class QueryInterface::Server::Transformations::TransformationScope
Attributes
excludes[RW]
filters[RW]
orders[RW]
updates[RW]
withs[RW]
Public Class Methods
new()
click to toggle source
# File lib/query-interface-server/transformations.rb, line 49 def initialize self.excludes = {} self.filters = {} self.withs = {} self.orders = {} self.updates = {} end
Public Instance Methods
auto_exclude(*names)
click to toggle source
# File lib/query-interface-server/transformations.rb, line 57 def auto_exclude(*names) names.each do |name| self.excludes[name] = Proc.new do |param| exclude(Sequel.qualify(model.table_name, name) => param) end end end
auto_filter(*names)
click to toggle source
# File lib/query-interface-server/transformations.rb, line 65 def auto_filter(*names) names.each do |name| self.filters[name] = Proc.new do |param| filter(Sequel.qualify(model.table_name, name) => param) end end end
auto_update(*names)
click to toggle source
# File lib/query-interface-server/transformations.rb, line 73 def auto_update(*names) names.each do |name| self.updates[name] = Proc.new {|param| param} end end
exclude(name, &block)
click to toggle source
# File lib/query-interface-server/transformations.rb, line 79 def exclude(name, &block) self.excludes[name] = block end
filter(name, &block)
click to toggle source
# File lib/query-interface-server/transformations.rb, line 83 def filter(name, &block) self.filters[name] = block end
order(name, &block)
click to toggle source
# File lib/query-interface-server/transformations.rb, line 95 def order(name, &block) self.orders[name] = block end
update(name, &block)
click to toggle source
# File lib/query-interface-server/transformations.rb, line 87 def update(name, &block) self.updates[name] = block end
with(name, &block)
click to toggle source
# File lib/query-interface-server/transformations.rb, line 91 def with(name, &block) self.withs[name] = block end