Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f7f081847dc1
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c57a47e5b3be
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Nov 22, 2015

  1. Copy the full SHA
    81d2e14 View commit details

Commits on Nov 25, 2015

  1. Merge pull request #3486 from lucasallan/ruby-2.3-fetch_values

    [Ruby-2.3] - Implements Hash#fetch_values
    kares committed Nov 25, 2015
    Copy the full SHA
    c57a47e View commit details
Showing with 10 additions and 0 deletions.
  1. +10 −0 core/src/main/java/org/jruby/RubyHash.java
10 changes: 10 additions & 0 deletions core/src/main/java/org/jruby/RubyHash.java
Original file line number Diff line number Diff line change
@@ -1788,6 +1788,16 @@ public RubyArray values_at(ThreadContext context, IRubyObject[] args) {
return result;
}

@JRubyMethod(name = "fetch_values", rest = true)
public RubyArray fetch_values(ThreadContext context, IRubyObject[] args, Block block) {
RubyArray result = RubyArray.newArray(getRuntime(), args.length);

for (int i = 0; i < args.length; i++) {
result.append(fetch(context, args[i], block));
}
return result;
}

@JRubyMethod(name = "assoc")
public IRubyObject assoc(final ThreadContext context, final IRubyObject obj) {
try {