Module: VideoPromptLayerAudit
- Defined in:
- lib/video_prompt_layer_audit.rb,
lib/video_prompt_layer_audit/version.rb
Constant Summary collapse
- REQUIRED_LAYERS =
%i[subject motion camera].freeze
- VERSION =
"1.0.0"
Class Method Summary collapse
Class Method Details
.issues(brief) ⇒ Object
8 9 10 11 |
# File 'lib/video_prompt_layer_audit.rb', line 8 def self.issues(brief) missing = REQUIRED_LAYERS.reject { |key| brief.fetch(key, "").to_s.strip.length >= 8 } missing.map { |key| "#{key} is missing or too short" } end |
.summary(brief) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/video_prompt_layer_audit.rb', line 17 def self.summary(brief) %i[subject motion camera audio].filter_map do |key| value = brief.fetch(key, "").to_s.strip "#{key.to_s.capitalize}: #{value}" unless value.empty? end.join("\n") end |
.valid?(brief) ⇒ Boolean
13 14 15 |
# File 'lib/video_prompt_layer_audit.rb', line 13 def self.valid?(brief) issues(brief).empty? end |