lib/acfs/singleton_resource.rb in acfs-0.33.0.1.b278 vs lib/acfs/singleton_resource.rb in acfs-0.33.1
- old
+ new
@@ -70,19 +70,10 @@
# @yieldparam resource [ self ] Fetched resources.
#
# @return [ self ] Resource object.
#
def find(*attrs, &block)
- opts = { params: attrs.extract_options! }
-
- model = Util::ResourceDelegator.new self.new
-
- operation :read, opts do |data|
- model.__setobj__ create_resource data, origin: model.__getobj__
- block.call model unless block.nil?
- end
-
- model
+ find_single nil, params: attrs.extract_options!, &block
end
# @api public
#
# Undefined, raises NoMethodError.