module ZTK::DSL::Core::Actions::Find::ClassMethods

@author Zachary Patten <zpatten AT jovelabs DOT io>

Public Instance Methods

all() click to toggle source
# File lib/ztk/dsl/core/actions/find.rb, line 16
def all
  dataset
end
count() click to toggle source
# File lib/ztk/dsl/core/actions/find.rb, line 33
def count
  all.count
end
find(*args) click to toggle source
# File lib/ztk/dsl/core/actions/find.rb, line 20
def find(*args)
  ids = [args].flatten
  all.select{ |data| ids.include?(data.id) }
end
first(*args) click to toggle source
# File lib/ztk/dsl/core/actions/find.rb, line 25
def first(*args)
  if args.count == 0
    all.first
  else
    find(*args).first
  end
end