Class: RubynCode::Skills::TtlManager::Entry

Inherits:
Data
  • Object
show all
Defined in:
lib/rubyn_code/skills/ttl_manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#last_referenced_turnObject (readonly)

Returns the value of attribute last_referenced_turn

Returns:

  • (Object)

    the current value of last_referenced_turn



13
14
15
# File 'lib/rubyn_code/skills/ttl_manager.rb', line 13

def last_referenced_turn
  @last_referenced_turn
end

#loaded_at_turnObject (readonly)

Returns the value of attribute loaded_at_turn

Returns:

  • (Object)

    the current value of loaded_at_turn



13
14
15
# File 'lib/rubyn_code/skills/ttl_manager.rb', line 13

def loaded_at_turn
  @loaded_at_turn
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



13
14
15
# File 'lib/rubyn_code/skills/ttl_manager.rb', line 13

def name
  @name
end

#token_countObject (readonly)

Returns the value of attribute token_count

Returns:

  • (Object)

    the current value of token_count



13
14
15
# File 'lib/rubyn_code/skills/ttl_manager.rb', line 13

def token_count
  @token_count
end

#ttlObject (readonly)

Returns the value of attribute ttl

Returns:

  • (Object)

    the current value of ttl



13
14
15
# File 'lib/rubyn_code/skills/ttl_manager.rb', line 13

def ttl
  @ttl
end

Instance Method Details

#expired?(current_turn) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/rubyn_code/skills/ttl_manager.rb', line 14

def expired?(current_turn)
  current_turn - last_referenced_turn > ttl
end