Exception: Rubino::Memory::Store::BudgetExceededError

Inherits:
Error
  • Object
show all
Defined in:
lib/rubino/memory/store.rb

Overview

Raised when adding ‘content` to `kind`’s group would push the group’s total characters past the configured budget. Group rules live in Store#group_for_kind — user_profile is its own group, everything else shares the general “memory” budget.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(group:, limit:, current:, requested:) ⇒ BudgetExceededError

Returns a new instance of BudgetExceededError.



40
41
42
43
44
45
46
47
# File 'lib/rubino/memory/store.rb', line 40

def initialize(group:, limit:, current:, requested:)
  @group     = group
  @limit     = limit
  @current   = current
  @requested = requested
  super("memory budget exceeded for #{group}: " \
        "#{current}+#{requested} > #{limit}")
end

Instance Attribute Details

#currentObject (readonly)

Returns the value of attribute current.



38
39
40
# File 'lib/rubino/memory/store.rb', line 38

def current
  @current
end

#groupObject (readonly)

Returns the value of attribute group.



38
39
40
# File 'lib/rubino/memory/store.rb', line 38

def group
  @group
end

#limitObject (readonly)

Returns the value of attribute limit.



38
39
40
# File 'lib/rubino/memory/store.rb', line 38

def limit
  @limit
end

#requestedObject (readonly)

Returns the value of attribute requested.



38
39
40
# File 'lib/rubino/memory/store.rb', line 38

def requested
  @requested
end