Module: LHS::Record::Chainable::ClassMethods

Defined in:
lib/lhs/concerns/record/chainable.rb

Instance Method Summary collapse

Instance Method Details

#handle(error_class, handler) ⇒ Object



34
35
36
# File 'lib/lhs/concerns/record/chainable.rb', line 34

def handle(error_class, handler)
  Chain.new(self, ErrorHandling.new(error_class => handler))
end

#includes(*args) ⇒ Object



38
39
40
# File 'lib/lhs/concerns/record/chainable.rb', line 38

def includes(*args)
  Chain.new(self, Include.new(Chain.unfold(args)))
end

#limit(argument = nil) ⇒ Object



30
31
32
# File 'lib/lhs/concerns/record/chainable.rb', line 30

def limit(argument = nil)
  Chain.new(self, Pagination.new(per: argument))
end

#options(hash = nil) ⇒ Object



18
19
20
# File 'lib/lhs/concerns/record/chainable.rb', line 18

def options(hash = nil)
  Chain.new(self, Option.new(hash))
end

#page(page) ⇒ Object



22
23
24
# File 'lib/lhs/concerns/record/chainable.rb', line 22

def page(page)
  Chain.new(self, Pagination.new(page: page))
end

#per(limit) ⇒ Object



26
27
28
# File 'lib/lhs/concerns/record/chainable.rb', line 26

def per(limit)
  Chain.new(self, Pagination.new(per: limit))
end

#references(*args) ⇒ Object



42
43
44
# File 'lib/lhs/concerns/record/chainable.rb', line 42

def references(*args)
  Chain.new(self, Reference.new(Chain.unfold(args)))
end

#where(hash = nil) ⇒ Object



14
15
16
# File 'lib/lhs/concerns/record/chainable.rb', line 14

def where(hash = nil)
  Chain.new(self, Parameter.new(hash))
end