class Humidifier::Props::Prop

Superclass for all CFN properties

Constants

WHITELIST

The list of classes that are valid beyond the normal values for each prop

Attributes

key[R]
name[R]
spec[R]

Public Class Methods

allow_type(*types) click to toggle source
# File lib/humidifier/props.rb, line 49
def allow_type(*types)
  allowed_types
  @allowed_types += types
end
allowed_types() click to toggle source
# File lib/humidifier/props.rb, line 45
def allowed_types
  @allowed_types ||= [Fn, Ref]
end
new(key, spec = {}) click to toggle source
# File lib/humidifier/props.rb, line 13
def initialize(key, spec = {})
  @key  = key
  @name = key.underscore
  @spec = spec
end

Public Instance Methods

documentation() click to toggle source

the link to the AWS docs

# File lib/humidifier/props.rb, line 20
def documentation
  spec["Documentation"]
end
required?() click to toggle source

true if this property is required by the resource

# File lib/humidifier/props.rb, line 25
def required?
  spec["Required"]
end
to_cf(value) click to toggle source

CFN stack syntax

# File lib/humidifier/props.rb, line 30
def to_cf(value)
  [key, Serializer.dump(value)]
end
update_type() click to toggle source

the type of update that occurs when this property is updated on its associated resource

# File lib/humidifier/props.rb, line 36
def update_type
  spec["UpdateType"]
end
valid?(value) click to toggle source
# File lib/humidifier/props.rb, line 40
def valid?(value)
  self.class.allowed_types.any? { |type| value.is_a?(type) }
end