Class: SixthSense::Model::TestCase

Inherits:
Struct
  • Object
show all
Defined in:
lib/sixth_sense/model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#assertionsObject

Returns the value of attribute assertions

Returns:

  • (Object)

    the current value of assertions



36
37
38
# File 'lib/sixth_sense/model.rb', line 36

def assertions
  @assertions
end

#astObject

Returns the value of attribute ast

Returns:

  • (Object)

    the current value of ast



36
37
38
# File 'lib/sixth_sense/model.rb', line 36

def ast
  @ast
end

#bodyObject

Returns the value of attribute body

Returns:

  • (Object)

    the current value of body



36
37
38
# File 'lib/sixth_sense/model.rb', line 36

def body
  @body
end

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



36
37
38
# File 'lib/sixth_sense/model.rb', line 36

def description
  @description
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



36
37
38
# File 'lib/sixth_sense/model.rb', line 36

def id
  @id
end

#locationObject

Returns the value of attribute location

Returns:

  • (Object)

    the current value of location



36
37
38
# File 'lib/sixth_sense/model.rb', line 36

def location
  @location
end

#metadataObject

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



36
37
38
# File 'lib/sixth_sense/model.rb', line 36

def 
  @metadata
end

Instance Method Details

#executable_locObject



46
47
48
# File 'lib/sixth_sense/model.rb', line 46

def executable_loc
  body.to_s.lines.count { |line| line.match?(/\S/) }
end

#to_hObject



50
51
52
53
54
55
56
57
58
# File 'lib/sixth_sense/model.rb', line 50

def to_h
  {
    id: id,
    description: description,
    location: location&.to_h,
    assertions: assertions.map(&:to_h),
    metadata: 
  }
end