Method: Inspec::ProfileContext#register_attribute

Defined in:
lib/inspec/profile_context.rb

#register_attribute(name, options = {}) ⇒ Object



176
177
178
179
180
181
182
183
# File 'lib/inspec/profile_context.rb', line 176

def register_attribute(name, options = {})
  # we need to return an attribute object, to allow dermination of default values
  attr = Attribute.new(name, options)
  # read value from given gived values
  attr.value(@conf['attributes'][attr.name]) unless @conf['attributes'].nil?
  @attributes.push(attr)
  attr.value
end