Class: Kumi::Dev::Golden::Generator
- Inherits:
-
Object
- Object
- Kumi::Dev::Golden::Generator
- Defined in:
- lib/kumi/dev/golden/generator.rb
Instance Attribute Summary collapse
-
#expected_dir ⇒ Object
readonly
Returns the value of attribute expected_dir.
-
#schema_name ⇒ Object
readonly
Returns the value of attribute schema_name.
-
#schema_path ⇒ Object
readonly
Returns the value of attribute schema_path.
Instance Method Summary collapse
- #generate_all(representations, output_dir) ⇒ Object
-
#initialize(schema_name, schema_path, expected_dir) ⇒ Generator
constructor
A new instance of Generator.
- #update_all(representations) ⇒ Object
Constructor Details
#initialize(schema_name, schema_path, expected_dir) ⇒ Generator
Returns a new instance of Generator.
11 12 13 14 15 |
# File 'lib/kumi/dev/golden/generator.rb', line 11 def initialize(schema_name, schema_path, expected_dir) @schema_name = schema_name @schema_path = schema_path @expected_dir = expected_dir end |
Instance Attribute Details
#expected_dir ⇒ Object (readonly)
Returns the value of attribute expected_dir.
9 10 11 |
# File 'lib/kumi/dev/golden/generator.rb', line 9 def expected_dir @expected_dir end |
#schema_name ⇒ Object (readonly)
Returns the value of attribute schema_name.
9 10 11 |
# File 'lib/kumi/dev/golden/generator.rb', line 9 def schema_name @schema_name end |
#schema_path ⇒ Object (readonly)
Returns the value of attribute schema_path.
9 10 11 |
# File 'lib/kumi/dev/golden/generator.rb', line 9 def schema_path @schema_path end |
Instance Method Details
#generate_all(representations, output_dir) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/kumi/dev/golden/generator.rb', line 25 def generate_all(representations, output_dir) FileUtils.mkdir_p(output_dir) representations.map do |repr| generate_representation(repr, output_dir) end end |
#update_all(representations) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/kumi/dev/golden/generator.rb', line 17 def update_all(representations) FileUtils.mkdir_p(expected_dir) representations.map do |repr| update_representation(repr) end end |