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: opal/opal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cc9c43ba0cc9
Choose a base ref
...
head repository: opal/opal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9741c7e80fd1
Choose a head ref
  • 3 commits
  • 2 files changed
  • 2 contributors

Commits on Mar 16, 2015

  1. Copy the full SHA
    9c57274 View commit details
  2. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    d491790 View commit details
  3. Merge pull request #756 from vais/struct

    Struct#to_h implementation compliant with rubyspec
    meh committed Mar 16, 2015
    Copy the full SHA
    9741c7e View commit details
Showing with 4 additions and 5 deletions.
  1. +4 −0 opal/corelib/struct.rb
  2. +0 −5 spec/filters/bugs/struct.rb
4 changes: 4 additions & 0 deletions opal/corelib/struct.rb
Original file line number Diff line number Diff line change
@@ -138,4 +138,8 @@ def inspect
end

alias to_s inspect

def to_h
members.inject({}) {|h, name| h[name] = self[name]; h}
end
end
5 changes: 0 additions & 5 deletions spec/filters/bugs/struct.rb
Original file line number Diff line number Diff line change
@@ -11,9 +11,6 @@

fails "Struct#members does not override the instance accessor method"

fails "Struct#to_h returns a Hash with members as keys"
fails "Struct#to_h returns a Hash that is independent from the struct"

fails "Struct#initialize can be overriden"

fails "Struct#inspect returns a string representation of some kind"
@@ -32,6 +29,4 @@

fails "Struct#values_at fails when passed unsupported types"
fails "Struct#values_at returns an array of values"

fails "Struct anonymous class instance methods Enumerable methods should work"
end