summaryrefslogtreecommitdiff
path: root/lib/oxidized/nodes.rb
diff options
context:
space:
mode:
authornopedial <shafez@ike-2.local>2013-10-14 11:15:12 +0200
committernopedial <shafez@ike-2.local>2013-10-14 11:15:12 +0200
commit5bf9df1ebffd85604206d1baf81a5a92158a117a (patch)
tree211aa5994d0d956a7da60e419e316c3cefef8fcc /lib/oxidized/nodes.rb
parent6ab1fbb3f9f551b67a6481aafe3591e837905a8b (diff)
implement fetch into output model
Diffstat (limited to 'lib/oxidized/nodes.rb')
-rw-r--r--lib/oxidized/nodes.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/oxidized/nodes.rb b/lib/oxidized/nodes.rb
index e5e87e5..dcebe08 100644
--- a/lib/oxidized/nodes.rb
+++ b/lib/oxidized/nodes.rb
@@ -1,5 +1,6 @@
module Oxidized
require 'oxidized/node'
+ class Oxidized::NotSupported < StandardError; end
class Nodes < Array
attr_accessor :source
alias :put :unshift
@@ -26,6 +27,11 @@ module Oxidized
i = find_index node
self[i].serialize if i
end
+ def fetch node
+ i = find_index node
+ raise Oxidized::NotSupported unless Oxidized.mgr.output.respond_to? :fetch
+ self[i].output.new.fetch node
+ end
def del node
i = find_index node
delete_at i if i