Module: LHS::Record::Chainable::ClassMethods
- Defined in:
- lib/lhs/concerns/record/chainable.rb
Instance Method Summary collapse
- #all(hash = nil) ⇒ Object
- #expanded(options = nil) ⇒ Object
- #handle(error_class, handler) ⇒ Object
- #includes(*args) ⇒ Object
- #includes_all(*args) ⇒ Object
- #limit(argument = nil) ⇒ Object
- #options(hash = nil) ⇒ Object
- #page(page) ⇒ Object
- #per(limit) ⇒ Object
- #references(*args) ⇒ Object
- #where(hash = nil) ⇒ Object
Instance Method Details
#all(hash = nil) ⇒ Object
18 19 20 21 22 |
# File 'lib/lhs/concerns/record/chainable.rb', line 18 def all(hash = nil) chain = Chain.new(self, Parameter.new(hash)) chain._links.push(Option.new(all: true)) chain end |
#expanded(options = nil) ⇒ Object
24 25 26 |
# File 'lib/lhs/concerns/record/chainable.rb', line 24 def ( = nil) Chain.new(self, Option.new(expanded: || true)) end |
#handle(error_class, handler) ⇒ Object
44 45 46 |
# File 'lib/lhs/concerns/record/chainable.rb', line 44 def handle(error_class, handler) Chain.new(self, ErrorHandling.new(error_class => handler)) end |
#includes(*args) ⇒ Object
48 49 50 |
# File 'lib/lhs/concerns/record/chainable.rb', line 48 def includes(*args) Chain.new(self, Include.new(Chain.unfold(args))) end |
#includes_all(*args) ⇒ Object
52 53 54 55 56 |
# File 'lib/lhs/concerns/record/chainable.rb', line 52 def includes_all(*args) chain = Chain.new(self, Include.new(Chain.unfold(args))) chain.include_all!(args) chain end |
#limit(argument = nil) ⇒ Object
40 41 42 |
# File 'lib/lhs/concerns/record/chainable.rb', line 40 def limit(argument = nil) Chain.new(self, Pagination.new(per: argument)) end |
#options(hash = nil) ⇒ Object
28 29 30 |
# File 'lib/lhs/concerns/record/chainable.rb', line 28 def (hash = nil) Chain.new(self, Option.new(hash)) end |
#page(page) ⇒ Object
32 33 34 |
# File 'lib/lhs/concerns/record/chainable.rb', line 32 def page(page) Chain.new(self, Pagination.new(page: page)) end |
#per(limit) ⇒ Object
36 37 38 |
# File 'lib/lhs/concerns/record/chainable.rb', line 36 def per(limit) Chain.new(self, Pagination.new(per: limit)) end |