Class: RailsDoctor::ToolRun

Inherits:
Struct
  • Object
show all
Defined in:
lib/rails_doctor/models.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**kwargs) ⇒ ToolRun

Returns a new instance of ToolRun.



76
77
78
79
80
81
# File 'lib/rails_doctor/models.rb', line 76

def initialize(**kwargs)
  super
  self.available = true if available.nil?
  self.skipped = false if skipped.nil?
  self. ||= {}
end

Instance Attribute Details

#availableObject

Returns the value of attribute available

Returns:

  • (Object)

    the current value of available



63
64
65
# File 'lib/rails_doctor/models.rb', line 63

def available
  @available
end

#commandObject

Returns the value of attribute command

Returns:

  • (Object)

    the current value of command



63
64
65
# File 'lib/rails_doctor/models.rb', line 63

def command
  @command
end

#duration_msObject

Returns the value of attribute duration_ms

Returns:

  • (Object)

    the current value of duration_ms



63
64
65
# File 'lib/rails_doctor/models.rb', line 63

def duration_ms
  @duration_ms
end

#exit_statusObject

Returns the value of attribute exit_status

Returns:

  • (Object)

    the current value of exit_status



63
64
65
# File 'lib/rails_doctor/models.rb', line 63

def exit_status
  @exit_status
end

#metadataObject

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



63
64
65
# File 'lib/rails_doctor/models.rb', line 63

def 
  @metadata
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



63
64
65
# File 'lib/rails_doctor/models.rb', line 63

def name
  @name
end

#skip_reasonObject

Returns the value of attribute skip_reason

Returns:

  • (Object)

    the current value of skip_reason



63
64
65
# File 'lib/rails_doctor/models.rb', line 63

def skip_reason
  @skip_reason
end

#skippedObject

Returns the value of attribute skipped

Returns:

  • (Object)

    the current value of skipped



63
64
65
# File 'lib/rails_doctor/models.rb', line 63

def skipped
  @skipped
end

#stderrObject

Returns the value of attribute stderr

Returns:

  • (Object)

    the current value of stderr



63
64
65
# File 'lib/rails_doctor/models.rb', line 63

def stderr
  @stderr
end

#stdoutObject

Returns the value of attribute stdout

Returns:

  • (Object)

    the current value of stdout



63
64
65
# File 'lib/rails_doctor/models.rb', line 63

def stdout
  @stdout
end

Instance Method Details

#to_h(include_raw: false) ⇒ Object



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/rails_doctor/models.rb', line 83

def to_h(include_raw: false)
  hash = {
    name: name,
    available: available,
    skipped: skipped,
    command: command,
    exit_status: exit_status,
    duration_ms: duration_ms,
    skip_reason: skip_reason,
    metadata: 
  }.compact
  if include_raw
    hash[:stdout] = stdout
    hash[:stderr] = stderr
  end
  hash
end