Class: GeneratedImageImporter::Result

Inherits:
Data
  • Object
show all
Defined in:
app/services/generated_image_importer.rb

Overview

Service object: result.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(image: nil, notice: nil, error: nil) ⇒ Result

Returns a new instance of Result.



20
# File 'app/services/generated_image_importer.rb', line 20

def initialize(image: nil, notice: nil, error: nil) = super

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



19
20
21
# File 'app/services/generated_image_importer.rb', line 19

def error
  @error
end

#imageObject (readonly)

Returns the value of attribute image

Returns:

  • (Object)

    the current value of image



19
20
21
# File 'app/services/generated_image_importer.rb', line 19

def image
  @image
end

#noticeObject (readonly)

Returns the value of attribute notice

Returns:

  • (Object)

    the current value of notice



19
20
21
# File 'app/services/generated_image_importer.rb', line 19

def notice
  @notice
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


21
# File 'app/services/generated_image_importer.rb', line 21

def success? = error.nil? && image.present?