Class: Hitch::MCP::Internal::JsonValues::Copier

Inherits:
Object
  • Object
show all
Defined in:
app/models/hitch/mcp/internal/json_values.rb

Instance Method Summary collapse

Constructor Details

#initialize(keys:, symbols:, foreign:, finite:, duplicates:, freeze:, max_depth:, max_objects:, on_invalid:) ⇒ Copier

Returns a new instance of Copier.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'app/models/hitch/mcp/internal/json_values.rb', line 66

def initialize(keys:, symbols:, foreign:, finite:, duplicates:,
  freeze:, max_depth:, max_objects:, on_invalid:)
  @keys = keys
  @symbols = symbols
  @foreign = foreign
  @finite = finite
  @duplicates = duplicates
  @freeze = freeze
  @max_depth = max_depth
  @max_objects = max_objects
  @on_invalid = on_invalid
  @seen = Set.new
  @objects = 0
end

Instance Method Details

#call(value) ⇒ Object



81
82
83
# File 'app/models/hitch/mcp/internal/json_values.rb', line 81

def call(value)
  catch(REPLACED) { walk(value, 1) }
end