Class: BBC::Cosmos::Tools::Types::BaseType
- Inherits:
-
Object
- Object
- BBC::Cosmos::Tools::Types::BaseType
- Defined in:
- lib/bbc/cosmos/tools/types/base_type.rb
Instance Method Summary collapse
- #generate_data(to_json = false) ⇒ Object
-
#initialize(id, options, config) ⇒ BaseType
constructor
A new instance of BaseType.
Constructor Details
#initialize(id, options, config) ⇒ BaseType
Returns a new instance of BaseType.
9 10 11 12 13 |
# File 'lib/bbc/cosmos/tools/types/base_type.rb', line 9 def initialize(id, , config) @id = id = @config = config end |
Instance Method Details
#generate_data(to_json = false) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/bbc/cosmos/tools/types/base_type.rb', line 15 def generate_data(to_json = false) if valid_component_and_stack get_parameters.each do |key, value| if data.has_key?("Parameters") && data["Parameters"][key] data["Parameters"][key]["Default"] = value end end to_json ? JSON.pretty_generate(data) : data end end |