Parent

Class Index [+]

Quicksearch

MCollective::Data::Result

Public Class Methods

new(outputs) click to toggle source

(Not documented)

    # 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

[](key) click to toggle source

(Not documented)

    # File lib/mcollective/data/result.rb, line 21
21:       def [](key)
22:         @data[key.to_sym]
23:       end
[]=(key, val) click to toggle source

(Not documented)

    # 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
include?(key) click to toggle source

(Not documented)

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

(Not documented)

    # File lib/mcollective/data/result.rb, line 31
31:       def keys
32:         @data.keys
33:       end
method_missing(method, *args) click to toggle source

(Not documented)

    # 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

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.