Class: Textus::Domain::Freshness::Verdict

Inherits:
Data
  • Object
show all
Defined in:
lib/textus/domain/freshness/verdict.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#freshObject (readonly)

Returns the value of attribute fresh

Returns:

  • (Object)

    the current value of fresh



4
5
6
# File 'lib/textus/domain/freshness/verdict.rb', line 4

def fresh
  @fresh
end

#reasonObject (readonly)

Returns the value of attribute reason

Returns:

  • (Object)

    the current value of reason



4
5
6
# File 'lib/textus/domain/freshness/verdict.rb', line 4

def reason
  @reason
end

Class Method Details

.freshObject



5
# File 'lib/textus/domain/freshness/verdict.rb', line 5

def self.fresh         = new(fresh: true, reason: nil)

.stale(reason) ⇒ Object



6
# File 'lib/textus/domain/freshness/verdict.rb', line 6

def self.stale(reason) = new(fresh: false, reason: reason)

Instance Method Details

#fresh?Boolean

Returns:

  • (Boolean)


7
# File 'lib/textus/domain/freshness/verdict.rb', line 7

def fresh? = fresh

#stale?Boolean

Returns:

  • (Boolean)


8
# File 'lib/textus/domain/freshness/verdict.rb', line 8

def stale? = !fresh