X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=doc%2Fclasses%2FMCollective%2FData%2FResult.html;fp=doc%2Fclasses%2FMCollective%2FData%2FResult.html;h=56cf4fc5395a2e55856d46ba7ab83994a073dd5e;hb=d1f1649ba43c5cbc43c4beb2380096ba051d646a;hp=0000000000000000000000000000000000000000;hpb=8a3fe7daeecccf43dd71c59371c5005400d35101;p=packages%2Fprecise%2Fmcollective.git diff --git a/doc/classes/MCollective/Data/Result.html b/doc/classes/MCollective/Data/Result.html new file mode 100644 index 0000000..56cf4fc --- /dev/null +++ b/doc/classes/MCollective/Data/Result.html @@ -0,0 +1,278 @@ + + + + + + Class: MCollective::Data::Result + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassMCollective::Data::Result
In: + + lib/mcollective/data/result.rb + +
+
Parent: + Object +
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ +
+ []   + []=   + include?   + keys   + method_missing   + new   +
+
+ +
+ + + + +
+ + + + + + + + + +
+

Public Class methods

+ +
+ + + + +
+

[Source]

+
+
+    # File lib/mcollective/data/result.rb, line 9
+ 9:       def initialize(outputs)
+10:         @data = {}
+11: 
+12:         outputs.keys.each do |output|
+13:           @data[output] = Marshal.load(Marshal.dump(outputs[output].fetch(:default, nil)))
+14:         end
+15:       end
+
+
+
+
+ +

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+    # File lib/mcollective/data/result.rb, line 21
+21:       def [](key)
+22:         @data[key.to_sym]
+23:       end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+    # File lib/mcollective/data/result.rb, line 25
+25:       def []=(key, val)
+26:         raise "Can only store String, Integer, Float or Boolean data but got #{val.class} for key #{key}" unless [String, Fixnum, Bignum, Float, TrueClass, FalseClass].include?(val.class)
+27: 
+28:         @data[key.to_sym] = val
+29:       end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+    # File lib/mcollective/data/result.rb, line 17
+17:       def include?(key)
+18:         @data.include?(key.to_sym)
+19:       end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+    # File lib/mcollective/data/result.rb, line 31
+31:       def keys
+32:         @data.keys
+33:       end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+    # File lib/mcollective/data/result.rb, line 35
+35:       def method_missing(method, *args)
+36:         key = method.to_sym
+37: 
+38:         raise NoMethodError, "undefined local variable or method `%s'" % key unless include?(key)
+39: 
+40:         @data[key]
+41:       end
+
+
+
+
+ + +
+ + +
+ + +
+

[Validate]

+
+ + + \ No newline at end of file