Class: Marshalsea::Marshal::Limits
- Inherits:
-
Object
- Object
- Marshalsea::Marshal::Limits
- Defined in:
- lib/marshalsea/marshal/limits.rb
Constant Summary collapse
- DEFAULT_MAX_BYTES =
1_048_576- DEFAULT_MAX_DEPTH =
64- DEFAULT_MAX_NODES =
10_000- DEFAULT_MAX_REGISTERED_OBJECTS =
4_096- DEFAULT_MAX_SYMBOL_DEFINITIONS =
256- DEFAULT_MAX_COLLECTION_ENTRIES =
1_024- DEFAULT_MAX_SCALAR_BYTES =
262_144- DEFAULT_MAX_TOTAL_SCALAR_BYTES =
524_288- DEFAULT_MAX_OBJECT_LINKS =
2_048- DEFAULT_MAX_SYMBOL_REFERENCES =
2_048- DEFAULT_MAX_SYMBOL_NAME_BYTES =
1_024- DEFAULT_MAX_CLASS_NAME_BYTES =
1_024- DEFAULT_MAX_INSTANCE_VARIABLES =
256- DEFAULT_MAX_STRUCT_MEMBERS =
256- ROLE_BYTES =
"stream bytes"- ROLE_NODES =
"nodes"- ROLE_REGISTERED =
"registered objects"- ROLE_SYMBOLS =
"symbol definitions"- ROLE_ENTRIES =
"collection entries"- ROLE_SCALAR =
"scalar bytes"- ROLE_TOTAL_SCALAR =
"total scalar bytes"- ROLE_LINKS =
"object links"- ROLE_SYMBOL_REFERENCES =
"symbol references"- ROLE_SYMBOL_NAME =
"symbol name bytes"- ROLE_CLASS_NAME =
"class name bytes"- ROLE_INSTANCE_VARIABLES =
"instance variables"- ROLE_STRUCT_MEMBERS =
"struct members"- UNBOUNDED =
Float::INFINITY
- STACK_SAFE_MAX_DEPTH =
Constants::DEFAULT_MAX_DEPTH
Instance Attribute Summary collapse
-
#max_bytes ⇒ Object
readonly
Returns the value of attribute max_bytes.
-
#max_class_name_bytes ⇒ Object
readonly
Returns the value of attribute max_class_name_bytes.
-
#max_collection_entries ⇒ Object
readonly
Returns the value of attribute max_collection_entries.
-
#max_depth ⇒ Object
readonly
Returns the value of attribute max_depth.
-
#max_instance_variables ⇒ Object
readonly
Returns the value of attribute max_instance_variables.
-
#max_nodes ⇒ Object
readonly
Returns the value of attribute max_nodes.
-
#max_object_links ⇒ Object
readonly
Returns the value of attribute max_object_links.
-
#max_registered_objects ⇒ Object
readonly
Returns the value of attribute max_registered_objects.
-
#max_scalar_bytes ⇒ Object
readonly
Returns the value of attribute max_scalar_bytes.
-
#max_struct_members ⇒ Object
readonly
Returns the value of attribute max_struct_members.
-
#max_symbol_definitions ⇒ Object
readonly
Returns the value of attribute max_symbol_definitions.
-
#max_symbol_name_bytes ⇒ Object
readonly
Returns the value of attribute max_symbol_name_bytes.
-
#max_symbol_references ⇒ Object
readonly
Returns the value of attribute max_symbol_references.
-
#max_total_scalar_bytes ⇒ Object
readonly
Returns the value of attribute max_total_scalar_bytes.
Class Method Summary collapse
Instance Method Summary collapse
Constructor Details
#initialize(max_bytes: DEFAULT_MAX_BYTES, max_depth: DEFAULT_MAX_DEPTH, max_nodes: DEFAULT_MAX_NODES, max_registered_objects: DEFAULT_MAX_REGISTERED_OBJECTS, max_symbol_definitions: DEFAULT_MAX_SYMBOL_DEFINITIONS, max_collection_entries: DEFAULT_MAX_COLLECTION_ENTRIES, max_scalar_bytes: DEFAULT_MAX_SCALAR_BYTES, max_total_scalar_bytes: DEFAULT_MAX_TOTAL_SCALAR_BYTES, max_object_links: DEFAULT_MAX_OBJECT_LINKS, max_symbol_references: DEFAULT_MAX_SYMBOL_REFERENCES, max_symbol_name_bytes: DEFAULT_MAX_SYMBOL_NAME_BYTES, max_class_name_bytes: DEFAULT_MAX_CLASS_NAME_BYTES, max_instance_variables: DEFAULT_MAX_INSTANCE_VARIABLES, max_struct_members: DEFAULT_MAX_STRUCT_MEMBERS) ⇒ Limits
Returns a new instance of Limits.
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/marshalsea/marshal/limits.rb', line 45 def initialize( max_bytes: DEFAULT_MAX_BYTES, max_depth: DEFAULT_MAX_DEPTH, max_nodes: DEFAULT_MAX_NODES, max_registered_objects: DEFAULT_MAX_REGISTERED_OBJECTS, max_symbol_definitions: DEFAULT_MAX_SYMBOL_DEFINITIONS, max_collection_entries: DEFAULT_MAX_COLLECTION_ENTRIES, max_scalar_bytes: DEFAULT_MAX_SCALAR_BYTES, max_total_scalar_bytes: DEFAULT_MAX_TOTAL_SCALAR_BYTES, max_object_links: DEFAULT_MAX_OBJECT_LINKS, max_symbol_references: DEFAULT_MAX_SYMBOL_REFERENCES, max_symbol_name_bytes: DEFAULT_MAX_SYMBOL_NAME_BYTES, max_class_name_bytes: DEFAULT_MAX_CLASS_NAME_BYTES, max_instance_variables: DEFAULT_MAX_INSTANCE_VARIABLES, max_struct_members: DEFAULT_MAX_STRUCT_MEMBERS ) @max_bytes = max_bytes @max_depth = max_depth @max_nodes = max_nodes @max_registered_objects = max_registered_objects @max_symbol_definitions = max_symbol_definitions @max_collection_entries = max_collection_entries @max_scalar_bytes = max_scalar_bytes @max_total_scalar_bytes = max_total_scalar_bytes @max_object_links = max_object_links @max_symbol_references = max_symbol_references @max_symbol_name_bytes = max_symbol_name_bytes @max_class_name_bytes = max_class_name_bytes @max_instance_variables = max_instance_variables @max_struct_members = max_struct_members end |
Instance Attribute Details
#max_bytes ⇒ Object (readonly)
Returns the value of attribute max_bytes.
39 40 41 |
# File 'lib/marshalsea/marshal/limits.rb', line 39 def max_bytes @max_bytes end |
#max_class_name_bytes ⇒ Object (readonly)
Returns the value of attribute max_class_name_bytes.
39 40 41 |
# File 'lib/marshalsea/marshal/limits.rb', line 39 def max_class_name_bytes @max_class_name_bytes end |
#max_collection_entries ⇒ Object (readonly)
Returns the value of attribute max_collection_entries.
39 40 41 |
# File 'lib/marshalsea/marshal/limits.rb', line 39 def max_collection_entries @max_collection_entries end |
#max_depth ⇒ Object (readonly)
Returns the value of attribute max_depth.
39 40 41 |
# File 'lib/marshalsea/marshal/limits.rb', line 39 def max_depth @max_depth end |
#max_instance_variables ⇒ Object (readonly)
Returns the value of attribute max_instance_variables.
39 40 41 |
# File 'lib/marshalsea/marshal/limits.rb', line 39 def max_instance_variables @max_instance_variables end |
#max_nodes ⇒ Object (readonly)
Returns the value of attribute max_nodes.
39 40 41 |
# File 'lib/marshalsea/marshal/limits.rb', line 39 def max_nodes @max_nodes end |
#max_object_links ⇒ Object (readonly)
Returns the value of attribute max_object_links.
39 40 41 |
# File 'lib/marshalsea/marshal/limits.rb', line 39 def max_object_links @max_object_links end |
#max_registered_objects ⇒ Object (readonly)
Returns the value of attribute max_registered_objects.
39 40 41 |
# File 'lib/marshalsea/marshal/limits.rb', line 39 def max_registered_objects @max_registered_objects end |
#max_scalar_bytes ⇒ Object (readonly)
Returns the value of attribute max_scalar_bytes.
39 40 41 |
# File 'lib/marshalsea/marshal/limits.rb', line 39 def max_scalar_bytes @max_scalar_bytes end |
#max_struct_members ⇒ Object (readonly)
Returns the value of attribute max_struct_members.
39 40 41 |
# File 'lib/marshalsea/marshal/limits.rb', line 39 def max_struct_members @max_struct_members end |
#max_symbol_definitions ⇒ Object (readonly)
Returns the value of attribute max_symbol_definitions.
39 40 41 |
# File 'lib/marshalsea/marshal/limits.rb', line 39 def max_symbol_definitions @max_symbol_definitions end |
#max_symbol_name_bytes ⇒ Object (readonly)
Returns the value of attribute max_symbol_name_bytes.
39 40 41 |
# File 'lib/marshalsea/marshal/limits.rb', line 39 def max_symbol_name_bytes @max_symbol_name_bytes end |
#max_symbol_references ⇒ Object (readonly)
Returns the value of attribute max_symbol_references.
39 40 41 |
# File 'lib/marshalsea/marshal/limits.rb', line 39 def max_symbol_references @max_symbol_references end |
#max_total_scalar_bytes ⇒ Object (readonly)
Returns the value of attribute max_total_scalar_bytes.
39 40 41 |
# File 'lib/marshalsea/marshal/limits.rb', line 39 def max_total_scalar_bytes @max_total_scalar_bytes end |
Class Method Details
.permissive ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/marshalsea/marshal/limits.rb', line 79 def self.permissive new( max_bytes: UNBOUNDED, max_depth: STACK_SAFE_MAX_DEPTH, max_nodes: UNBOUNDED, max_registered_objects: UNBOUNDED, max_symbol_definitions: UNBOUNDED, max_collection_entries: UNBOUNDED, max_scalar_bytes: UNBOUNDED, max_total_scalar_bytes: UNBOUNDED, max_object_links: UNBOUNDED, max_symbol_references: UNBOUNDED, max_symbol_name_bytes: UNBOUNDED, max_class_name_bytes: UNBOUNDED, max_instance_variables: UNBOUNDED, max_struct_members: UNBOUNDED ) end |