Sha256: 34b1a7b194e20fb719f762c5c679cf1fae3347e6afbb12de9c3604259970d0c7
Contents?: true
Size: 859 Bytes
Versions: 15
Compression:
Stored size: 859 Bytes
Contents
module RSpecSystem # This object represents a prefab definition from the prefabs.yml file class Prefab attr_reader :name attr_reader :description attr_reader :facts attr_reader :provider_specifics # Return prefab object based on name def self.prefab(name) prefabs = YAML.load_file(File.join(File.dirname(__FILE__), '..', '..', 'resources', 'prefabs.yml')) raise "No such prefab" unless pf = prefabs[name] RSpecSystem::Prefab.new( :name => name, :description => pf['description'], :facts => pf['facts'], :provider_specifics => pf['provider_specifics'] ) end def initialize(options = {}) @name = options[:name] @description = options[:description] @facts = options[:facts] @provider_specifics = options[:provider_specifics] end end end
Version data entries
15 entries across 15 versions & 1 rubygems