Class/Module Index [+]

Quicksearch

CIMI::Model::EntityMetadata

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Public Class Methods

find(id, context) click to toggle source
# File lib/cimi/model/entity_metadata.rb, line 38
def self.find(id, context)
  entity_metadata = []
  if id == :all
    CIMI::Model.root_entities.each do |entity|
      entity_class = CIMI::Model.const_get("#{entity.singularize}")
      entity_metadata << entity_class.create_entity_metadata(context) if entity_class.respond_to?("create_entity_metadata")
    end
    return entity_metadata
  else
    entity_class = CIMI::Model.const_get("#{id.camelize}")
    entity_metadata << entity_class.create_entity_metadata(context) if entity_class.respond_to?("create_entity_metadata")
    return entity_metadata.first
  end
end
metadata_from_deltacloud_features(cimi_entity, dcloud_entity, context) click to toggle source
# File lib/cimi/model/entity_metadata.rb, line 53
def self.metadata_from_deltacloud_features(cimi_entity, dcloud_entity, context)
    deltacloud_features = context.driver.features(dcloud_entity)
    metadata_attributes = deltacloud_features.map{|f| attributes_from_feature(f)}
    from_feature(cimi_entity, context, metadata_attributes.flatten!)
end

Public Instance Methods

includes_attribute?(attribute) click to toggle source
# File lib/cimi/model/entity_metadata.rb, line 59
def includes_attribute?(attribute)
  self.attributes.any?{|attr| attr[:name] == attribute}
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.