Class: FlagTemplateParameter

Inherits:
Object
  • Object
show all
Defined in:
lib/ccios/flag_template_parameter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parameter_template_definition_hash) ⇒ FlagTemplateParameter

Returns a new instance of FlagTemplateParameter.



4
5
6
7
8
9
10
11
12
# File 'lib/ccios/flag_template_parameter.rb', line 4

def initialize(parameter_template_definition_hash)
  @name = parameter_template_definition_hash["flag"]
  @short_name = parameter_template_definition_hash["short_name"]
  @description = parameter_template_definition_hash["description"] || ""
  @template_variable_name = parameter_template_definition_hash["template_variable_name"] || @name

  raise "Missing flag name" if @name.nil? || @name.empty?
  raise "Invalid flag template_variable_name for #{@name}" if @template_variable_name.nil? || template_variable_name.empty?
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



2
3
4
# File 'lib/ccios/flag_template_parameter.rb', line 2

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



2
3
4
# File 'lib/ccios/flag_template_parameter.rb', line 2

def name
  @name
end

#short_nameObject (readonly)

Returns the value of attribute short_name.



2
3
4
# File 'lib/ccios/flag_template_parameter.rb', line 2

def short_name
  @short_name
end

#template_variable_nameObject (readonly)

Returns the value of attribute template_variable_name.



2
3
4
# File 'lib/ccios/flag_template_parameter.rb', line 2

def template_variable_name
  @template_variable_name
end

Instance Method Details

#provided_context_keysObject



14
15
16
# File 'lib/ccios/flag_template_parameter.rb', line 14

def provided_context_keys
  [@template_variable_name]
end