module Obscured::Timeline::Service::Base
Public Class Methods
included(base)
click to toggle source
# File lib/obscured-timeline/service.rb, line 7 def self.included(base) base.extend ClassMethods end
Public Instance Methods
all(criterion = {})
click to toggle source
# File lib/obscured-timeline/service.rb, line 11 def all(criterion = {}) Record.with(collection: "#{self.class.name.demodulize.downcase}_timeline") do |m| m.all(criterion).to_a end end
by(params = {}, options = {})
click to toggle source
# File lib/obscured-timeline/service.rb, line 35 def by(params = {}, options = {}) Record.with(collection: "#{self.class.name.demodulize.downcase}_timeline") do |m| m.by(params, options) end end
delete(id)
click to toggle source
# File lib/obscured-timeline/service.rb, line 41 def delete(id) Record.with(collection: "#{self.class.name.demodulize.downcase}_timeline") do |m| m.where(id: id).delete end end
find(*args)
click to toggle source
# File lib/obscured-timeline/service.rb, line 17 def find(*args) Record.with(collection: "#{self.class.name.demodulize.downcase}_timeline") do |m| m.find(*args) end end
find_by(attrs = {})
click to toggle source
# File lib/obscured-timeline/service.rb, line 23 def find_by(attrs = {}) Record.with(collection: "#{self.class.name.demodulize.downcase}_timeline") do |m| m.find_by(attrs).to_a end end
where(expression)
click to toggle source
# File lib/obscured-timeline/service.rb, line 29 def where(expression) Record.with(collection: "#{self.class.name.demodulize.downcase}_timeline") do |m| m.where(expression).to_a end end