Class: Codeball::ExtractionResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/codeball/extraction_result.rb

Overview

Represents the outcome of extracting a single entry from a codeball.

## Example

“‘ruby

puts "Wrote #{result.path}"
puts "Failed: #{result.error}"

“‘

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#errorObject

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



11
12
13
# File 'lib/codeball/extraction_result.rb', line 11

def error
  @error
end

#line_countObject

Returns the value of attribute line_count

Returns:

  • (Object)

    the current value of line_count



11
12
13
# File 'lib/codeball/extraction_result.rb', line 11

def line_count
  @line_count
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



11
12
13
# File 'lib/codeball/extraction_result.rb', line 11

def path
  @path
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



11
12
13
# File 'lib/codeball/extraction_result.rb', line 11

def status
  @status
end

Instance Method Details

#success?Boolean

Whether the extraction completed successfully. Both actual writes and dry-run simulations count as success.

Returns:

  • (Boolean)


14
# File 'lib/codeball/extraction_result.rb', line 14

def success? = %i[written dry_run].include?(status)