Class: Nanoc::Core::OutdatednessStatus Private

Inherits:
Object
  • Object
show all
Defined in:
lib/nanoc/core/outdatedness_status.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reasons: [], props: Nanoc::Core::DependencyProps.new) ⇒ OutdatednessStatus

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of OutdatednessStatus.



10
11
12
13
# File 'lib/nanoc/core/outdatedness_status.rb', line 10

def initialize(reasons: [], props: Nanoc::Core::DependencyProps.new)
  @reasons = reasons
  @props = props
end

Instance Attribute Details

#propsObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
# File 'lib/nanoc/core/outdatedness_status.rb', line 8

def props
  @props
end

#reasonsObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7
8
9
# File 'lib/nanoc/core/outdatedness_status.rb', line 7

def reasons
  @reasons
end

Instance Method Details

#update(reason) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



19
20
21
22
23
24
# File 'lib/nanoc/core/outdatedness_status.rb', line 19

def update(reason)
  self.class.new(
    reasons: @reasons + [reason],
    props: @props.merge(reason.props),
  )
end

#useful_to_apply?(rule) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


15
16
17
# File 'lib/nanoc/core/outdatedness_status.rb', line 15

def useful_to_apply?(rule)
  (rule.affected_props - @props.active).any?
end