class Kitchen::Terraform::FilePathConfigAttributeDefiner

FilePathConfigAttributeDefiner is the class of objects which define a file path configuration attribute on a plugin class.

Attributes

attribute[RW]
definer[RW]

Public Class Methods

new(attribute:, schema:) click to toggle source

initialize prepares a new instance of the class.

@param attribute [Kitchen::Terraform::ConfigAttribute] an attribute to be defined on a plugin class. @param schema [Dry::Validation::Schema] a schema to use for validation of values of the attribute. @return [Kitchen::Terraform::FilePathConfigAttributeDefiner]

# File lib/kitchen/terraform/file_path_config_attribute_definer.rb, line 41
def initialize(attribute:, schema:)
  self.attribute = attribute
  self.definer = ::Kitchen::Terraform::ConfigAttributeDefiner.new attribute: attribute, schema: schema
end

Public Instance Methods

define(plugin_class:) click to toggle source

define defines the file path configuration attribute on a plugin class.

@param plugin_class [Kitchen::ConfigAttributeVerifier] a plugin class which has configuration

attribute verification behaviour.

@return [self]

# File lib/kitchen/terraform/file_path_config_attribute_definer.rb, line 29
def define(plugin_class:)
  definer.define plugin_class: plugin_class
  plugin_class.expand_path_for attribute.to_sym

  self
end