|
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; |
@@ -514,6 +515,54 @@ public IRubyObject mark(ThreadContext context) { |
514 | 515 | ); |
515 | 516 | } |
516 | 517 |
|
| 518 | + @JRubyMethod(name = "max_aliases_for_collections=") |
| 519 | + public IRubyObject max_aliases_for_collections_set(IRubyObject max) { |
| 520 | + loadSettingsBuilder.setMaxAliasesForCollections(max.convertToInteger().getIntValue()); |
| 521 | + |
| 522 | + return max; |
| 523 | + } |
| 524 | + |
| 525 | + @JRubyMethod(name = "max_aliases_for_collections") |
| 526 | + public IRubyObject max_aliases_for_collections(ThreadContext context) { |
| 527 | + return context.runtime.newFixnum(buildSettings().getMaxAliasesForCollections()); |
| 528 | + } |
| 529 | + |
| 530 | + @JRubyMethod(name = "allow_duplicate_keys=") |
| 531 | + public IRubyObject allow_duplicate_keys_set(IRubyObject allow) { |
| 532 | + loadSettingsBuilder.setAllowDuplicateKeys(allow.isTrue()); |
| 533 | + |
| 534 | + return allow; |
| 535 | + } |
| 536 | + |
| 537 | + @JRubyMethod(name = "allow_duplicate_keys") |
| 538 | + public IRubyObject allow_duplicate_keys(ThreadContext context) { |
| 539 | + return RubyBoolean.newBoolean(context, buildSettings().getAllowDuplicateKeys()); |
| 540 | + } |
| 541 | + |
| 542 | + @JRubyMethod(name = "allow_recursive_keys=") |
| 543 | + public IRubyObject allow_recursive_keys_set(IRubyObject allow) { |
| 544 | + loadSettingsBuilder.setAllowRecursiveKeys(allow.isTrue()); |
| 545 | + |
| 546 | + return allow; |
| 547 | + } |
| 548 | + |
| 549 | + @JRubyMethod(name = "allow_recursive_keys") |
| 550 | + public IRubyObject allow_recursive_keys(ThreadContext context) { |
| 551 | + return RubyBoolean.newBoolean(context, buildSettings().getAllowRecursiveKeys()); |
| 552 | + } |
| 553 | + |
| 554 | + @JRubyMethod(name = "code_point_limit=") |
| 555 | + public IRubyObject code_point_limit_set(IRubyObject limit) { |
| 556 | + loadSettingsBuilder.setCodePointLimit(limit.convertToInteger().getIntValue()); |
| 557 | + |
| 558 | + return limit; |
| 559 | + } |
| 560 | + |
| 561 | + @JRubyMethod(name = "code_point_limit") |
| 562 | + public IRubyObject code_point_limit(ThreadContext context) { |
| 563 | + return context.runtime.newFixnum(buildSettings().getCodePointLimit()); |
| 564 | + } |
| 565 | + |
517 | 566 | private LoadSettings buildSettings() { |
518 | 567 | return loadSettingsBuilder.build(); |
519 | 568 | } |
|
0 commit comments