Method: BuildCloud::Component::ClassMethods#search

Defined in:
lib/build-cloud/component.rb

#search(options) ⇒ Object



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/build-cloud/component.rb', line 115

def search(options)

    objects = self.send :class_variable_get, :@@objects

    objects.select { |o|

        matches = true

        options.each_pair do |k,v|

            unless o.has_key?(k) and o[k] == v
                matches = false
            end

        end

        matches

    }

end