Class: StableDiffusionRuby::Result
- Inherits:
-
Object
- Object
- StableDiffusionRuby::Result
- Defined in:
- lib/stable_diffusion_ruby/result.rb
Instance Attribute Summary collapse
-
#output_path ⇒ Object
readonly
Returns the value of attribute output_path.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #error ⇒ Object
-
#initialize(data) ⇒ Result
constructor
A new instance of Result.
- #success? ⇒ Boolean
Constructor Details
#initialize(data) ⇒ Result
Returns a new instance of Result.
7 8 9 10 |
# File 'lib/stable_diffusion_ruby/result.rb', line 7 def initialize(data) @raw = data @output_path = data["output_path"] end |
Instance Attribute Details
#output_path ⇒ Object (readonly)
Returns the value of attribute output_path.
5 6 7 |
# File 'lib/stable_diffusion_ruby/result.rb', line 5 def output_path @output_path end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
5 6 7 |
# File 'lib/stable_diffusion_ruby/result.rb', line 5 def raw @raw end |
Instance Method Details
#error ⇒ Object
16 17 18 |
# File 'lib/stable_diffusion_ruby/result.rb', line 16 def error raw["error"] end |
#success? ⇒ Boolean
12 13 14 |
# File 'lib/stable_diffusion_ruby/result.rb', line 12 def success? !output_path.nil? && !raw.key?("error") end |