summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/outputs.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized/model/outputs.rb')
-rw-r--r--lib/oxidized/model/outputs.rb41
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/oxidized/model/outputs.rb b/lib/oxidized/model/outputs.rb
new file mode 100644
index 0000000..a668e9d
--- /dev/null
+++ b/lib/oxidized/model/outputs.rb
@@ -0,0 +1,41 @@
+module Oxidized
+ class Model
+ class Outputs
+
+ def to_cfg
+ type_to_str(nil)
+ end
+
+ def type_to_str want_type
+ type(want_type).map { |out| out }.join
+ end
+
+ def << output
+ @outputs << output
+ end
+
+ def unshift output
+ @outputs.unshift output
+ end
+
+ def all
+ @outputs
+ end
+
+ def type type
+ @outputs.select { |out| out.type==type }
+ end
+
+ def types
+ @outputs.map { |out| out.type }.uniq.compact
+ end
+
+ private
+
+ def initialize
+ @outputs = []
+ end
+
+ end
+ end
+end