class Agave::Local::ItemsRepo::ItemCollection

Public Instance Methods

[](id) click to toggle source
Calls superclass method
# File lib/agave/local/items_repo.rb, line 192
def [](id)
  if id.is_a? String
    find { |item| item.id == id }
  else
    super(id)
  end
end
each(&block) click to toggle source
Calls superclass method
# File lib/agave/local/items_repo.rb, line 182
def each(&block)
  if block && block.arity == 2
    each_with_object({}) do |item, acc|
      acc[item.id] = item
    end.each(&block)
  else
    super(&block)
  end
end
keys() click to toggle source
# File lib/agave/local/items_repo.rb, line 200
def keys
  map(&:id)
end
values() click to toggle source
# File lib/agave/local/items_repo.rb, line 204
def values
  to_a
end