|
34 | 34 | import org.jcodings.unicode.UnicodeEncoding; |
35 | 35 | import org.jruby.Ruby; |
36 | 36 | import org.jruby.RubyArray; |
| 37 | +import org.jruby.RubyBoolean; |
37 | 38 | import org.jruby.RubyClass; |
38 | 39 | import org.jruby.RubyEncoding; |
39 | 40 | import org.jruby.RubyFixnum; |
@@ -488,6 +489,54 @@ public IRubyObject mark(ThreadContext context) { |
488 | 489 | ); |
489 | 490 | } |
490 | 491 |
|
| 492 | + @JRubyMethod(name = "max_aliases_for_collections=") |
| 493 | + public IRubyObject max_aliases_for_collections_set(IRubyObject max) { |
| 494 | + loadSettingsBuilder.setMaxAliasesForCollections(max.convertToInteger().getIntValue()); |
| 495 | + |
| 496 | + return max; |
| 497 | + } |
| 498 | + |
| 499 | + @JRubyMethod(name = "max_aliases_for_collections") |
| 500 | + public IRubyObject max_aliases_for_collections(ThreadContext context) { |
| 501 | + return context.runtime.newFixnum(buildSettings().getMaxAliasesForCollections()); |
| 502 | + } |
| 503 | + |
| 504 | + @JRubyMethod(name = "allow_duplicate_keys=") |
| 505 | + public IRubyObject allow_duplicate_keys_set(IRubyObject allow) { |
| 506 | + loadSettingsBuilder.setAllowDuplicateKeys(allow.isTrue()); |
| 507 | + |
| 508 | + return allow; |
| 509 | + } |
| 510 | + |
| 511 | + @JRubyMethod(name = "allow_duplicate_keys") |
| 512 | + public IRubyObject allow_duplicate_keys(ThreadContext context) { |
| 513 | + return RubyBoolean.newBoolean(context, buildSettings().getAllowDuplicateKeys()); |
| 514 | + } |
| 515 | + |
| 516 | + @JRubyMethod(name = "allow_recursive_keys=") |
| 517 | + public IRubyObject allow_recursive_keys_set(IRubyObject allow) { |
| 518 | + loadSettingsBuilder.setAllowRecursiveKeys(allow.isTrue()); |
| 519 | + |
| 520 | + return allow; |
| 521 | + } |
| 522 | + |
| 523 | + @JRubyMethod(name = "allow_recursive_keys") |
| 524 | + public IRubyObject allow_recursive_keys(ThreadContext context) { |
| 525 | + return RubyBoolean.newBoolean(context, buildSettings().getAllowRecursiveKeys()); |
| 526 | + } |
| 527 | + |
| 528 | + @JRubyMethod(name = "code_point_limit=") |
| 529 | + public IRubyObject code_point_limit_set(IRubyObject limit) { |
| 530 | + loadSettingsBuilder.setCodePointLimit(limit.convertToInteger().getIntValue()); |
| 531 | + |
| 532 | + return limit; |
| 533 | + } |
| 534 | + |
| 535 | + @JRubyMethod(name = "code_point_limit") |
| 536 | + public IRubyObject code_point_limit(ThreadContext context) { |
| 537 | + return context.runtime.newFixnum(buildSettings().getCodePointLimit()); |
| 538 | + } |
| 539 | + |
491 | 540 | private LoadSettings buildSettings() { |
492 | 541 | return loadSettingsBuilder.build(); |
493 | 542 | } |
|
0 commit comments