Class: DrawCloud::Parameter
Instance Attribute Summary collapse
-
#allowed_pattern ⇒ Object
Returns the value of attribute allowed_pattern.
-
#allowed_values ⇒ Object
Returns the value of attribute allowed_values.
-
#constraint_description ⇒ Object
Returns the value of attribute constraint_description.
-
#default ⇒ Object
Returns the value of attribute default.
-
#description ⇒ Object
Returns the value of attribute description.
-
#max_length ⇒ Object
Returns the value of attribute max_length.
-
#max_value ⇒ Object
Returns the value of attribute max_value.
-
#min_length ⇒ Object
Returns the value of attribute min_length.
-
#min_value ⇒ Object
Returns the value of attribute min_value.
-
#name ⇒ Object
Returns the value of attribute name.
-
#no_echo ⇒ Object
Returns the value of attribute no_echo.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from Base
#as_groups, #as_launch_configurations, #deletion_policy, #depends_on, #ec2_instances, #elastic_ips, #gateways, #iam_access_keys, #iam_policies, #iam_users, #mappings, #metadata, #network_acls, #network_interfaces, #outputs, #parameters, #parent, #rdses, #resources, #route_tables, #security_groups, #sns_topics, #subnets, #vpcs, #wait_handles
Instance Method Summary collapse
-
#initialize(name, type, options = {}, &block) ⇒ Parameter
constructor
A new instance of Parameter.
- #load_into_config(config) ⇒ Object
- #to_h ⇒ Object
Methods inherited from Base
#[], #accessor, #add_standard_properties, #create_as_group, #create_as_launch_configuration, #create_ec2_instance, #create_ec2_instance_template, #create_elastic_ip, #create_iam_access_key, #create_iam_policy, #create_iam_user, #create_mapping, #create_network_acl, #create_network_interface, #create_output, #create_parameter, #create_rds, #create_route_table, #create_security_group, #create_service, #create_sns_topic, #create_subnet, #create_vpc, #create_wait_handle, #ref, #resource_name
Methods included from Locations
Methods included from Utilities
#desplice, #fnbase64, #fngetatt, #fnjoin, #hash_to_tag_array, #region, #resource_style, #splice, #stack_name
Constructor Details
#initialize(name, type, options = {}, &block) ⇒ Parameter
Returns a new instance of Parameter.
27 28 29 30 31 |
# File 'lib/draw_cloud/parameter.rb', line 27 def initialize(name, type, ={}, &block) @name = name @type = type super(, &block) end |
Instance Attribute Details
#allowed_pattern ⇒ Object
Returns the value of attribute allowed_pattern.
21 22 23 |
# File 'lib/draw_cloud/parameter.rb', line 21 def allowed_pattern @allowed_pattern end |
#allowed_values ⇒ Object
Returns the value of attribute allowed_values.
21 22 23 |
# File 'lib/draw_cloud/parameter.rb', line 21 def allowed_values @allowed_values end |
#constraint_description ⇒ Object
Returns the value of attribute constraint_description.
21 22 23 |
# File 'lib/draw_cloud/parameter.rb', line 21 def constraint_description @constraint_description end |
#default ⇒ Object
Returns the value of attribute default.
21 22 23 |
# File 'lib/draw_cloud/parameter.rb', line 21 def default @default end |
#description ⇒ Object
Returns the value of attribute description.
21 22 23 |
# File 'lib/draw_cloud/parameter.rb', line 21 def description @description end |
#max_length ⇒ Object
Returns the value of attribute max_length.
21 22 23 |
# File 'lib/draw_cloud/parameter.rb', line 21 def max_length @max_length end |
#max_value ⇒ Object
Returns the value of attribute max_value.
21 22 23 |
# File 'lib/draw_cloud/parameter.rb', line 21 def max_value @max_value end |
#min_length ⇒ Object
Returns the value of attribute min_length.
21 22 23 |
# File 'lib/draw_cloud/parameter.rb', line 21 def min_length @min_length end |
#min_value ⇒ Object
Returns the value of attribute min_value.
21 22 23 |
# File 'lib/draw_cloud/parameter.rb', line 21 def min_value @min_value end |
#name ⇒ Object
Returns the value of attribute name.
21 22 23 |
# File 'lib/draw_cloud/parameter.rb', line 21 def name @name end |
#no_echo ⇒ Object
Returns the value of attribute no_echo.
21 22 23 |
# File 'lib/draw_cloud/parameter.rb', line 21 def no_echo @no_echo end |
#type ⇒ Object
Returns the value of attribute type.
21 22 23 |
# File 'lib/draw_cloud/parameter.rb', line 21 def type @type end |
Instance Method Details
#load_into_config(config) ⇒ Object
33 34 35 36 |
# 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 ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# 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 |