|
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; |
@@ -487,6 +488,42 @@ public IRubyObject mark(ThreadContext context) { |
487 | 488 | ); |
488 | 489 | } |
489 | 490 |
|
| 491 | + @JRubyMethod(name = "max_aliases_for_collections=") |
| 492 | + public IRubyObject max_aliases_for_collections_set(IRubyObject max) { |
| 493 | + loadSettingsBuilder.setMaxAliasesForCollections(max.convertToInteger().getIntValue()); |
| 494 | + |
| 495 | + return max; |
| 496 | + } |
| 497 | + |
| 498 | + @JRubyMethod(name = "max_aliases_for_collections") |
| 499 | + public IRubyObject max_aliases_for_collections(ThreadContext context) { |
| 500 | + return context.runtime.newFixnum(buildSettings().getMaxAliasesForCollections()); |
| 501 | + } |
| 502 | + |
| 503 | + @JRubyMethod(name = "allow_duplicate_keys=") |
| 504 | + public IRubyObject allow_duplicate_keys_set(IRubyObject allow) { |
| 505 | + loadSettingsBuilder.setAllowDuplicateKeys(allow.isTrue()); |
| 506 | + |
| 507 | + return allow; |
| 508 | + } |
| 509 | + |
| 510 | + @JRubyMethod(name = "allow_duplicate_keys") |
| 511 | + public IRubyObject allow_duplicate_keys(ThreadContext context) { |
| 512 | + return RubyBoolean.newBoolean(context, buildSettings().getAllowDuplicateKeys()); |
| 513 | + } |
| 514 | + |
| 515 | + @JRubyMethod(name = "allow_recursive_keys=") |
| 516 | + public IRubyObject allow_recursive_keys_set(IRubyObject allow) { |
| 517 | + loadSettingsBuilder.setAllowRecursiveKeys(allow.isTrue()); |
| 518 | + |
| 519 | + return allow; |
| 520 | + } |
| 521 | + |
| 522 | + @JRubyMethod(name = "allow_recursive_keys") |
| 523 | + public IRubyObject allow_recursive_keys(ThreadContext context) { |
| 524 | + return RubyBoolean.newBoolean(context, buildSettings().getAllowRecursiveKeys()); |
| 525 | + } |
| 526 | + |
490 | 527 | private LoadSettings buildSettings() { |
491 | 528 | return loadSettingsBuilder.build(); |
492 | 529 | } |
|
0 commit comments