class DrawCloud::Parameter

Attributes

allowed_pattern[RW]
allowed_values[RW]
constraint_description[RW]
default[RW]
description[RW]
max_length[RW]
max_value[RW]
min_length[RW]
min_value[RW]
name[RW]
no_echo[RW]
type[RW]

Public Class Methods

new(name, type, options={}, &block) click to toggle source
Calls superclass method DrawCloud::Base::new
# File lib/draw_cloud/parameter.rb, line 27
def initialize(name, type, options={}, &block)
  @name = name
  @type = type
  super(options, &block)
end

Public Instance Methods

load_into_config(config) click to toggle source
Calls superclass method DrawCloud::Base#load_into_config
# File lib/draw_cloud/parameter.rb, line 33
def load_into_config(config)
  config.cf_add_parameter resource_name, self
  super(config)
end
to_h() click to toggle source
# File lib/draw_cloud/parameter.rb, line 38
def to_h
  h = {"Type" => DrawCloud.ref(type)}
  [:type, :default, :no_echo,
   :allowed_values, :max_length, :min_length,
   :max_value, :min_value,
   :constraint_description].each do |prop_str|
    prop = prop_str.intern
    h[resource_style(prop)] = DrawCloud.ref(self.send(prop)) unless self.send(prop).nil?
  end
  if !allowed_pattern.nil?
    h["AllowedPattern"] = case allowed_pattern
                          when Regexp
                            allowed_pattern.source
                          else
                            allowed_pattern.to_s
                          end
  end
  h
end