Class: Hashira::CI::Diff

Inherits:
Data
  • Object
show all
Defined in:
lib/hashira/ci/diff.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(worsened: []) ⇒ Diff

Returns a new instance of Diff.



7
# File 'lib/hashira/ci/diff.rb', line 7

def initialize(worsened: [], **) = super

Instance Attribute Details

#addedObject (readonly)

Returns the value of attribute added

Returns:

  • (Object)

    the current value of added



5
6
7
# File 'lib/hashira/ci/diff.rb', line 5

def added
  @added
end

#removedObject (readonly)

Returns the value of attribute removed

Returns:

  • (Object)

    the current value of removed



5
6
7
# File 'lib/hashira/ci/diff.rb', line 5

def removed
  @removed
end

#worsenedObject (readonly)

Returns the value of attribute worsened

Returns:

  • (Object)

    the current value of worsened



5
6
7
# File 'lib/hashira/ci/diff.rb', line 5

def worsened
  @worsened
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


8
# File 'lib/hashira/ci/diff.rb', line 8

def empty? = added.empty? && removed.empty? && worsened.empty?

#worse?Boolean

Returns:

  • (Boolean)


9
# File 'lib/hashira/ci/diff.rb', line 9

def worse? = !added.empty? || !worsened.empty?