Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Release? #15

Closed
MichaelXavier opened this Issue Sep 12, 2013 · 6 comments

Comments

Projects
None yet
6 participants

Was wondering if you're close to releasing a new version to rubbygems. I keep finding myself needing the method customization feature and it not being available on the published version.

Owner

tcrayford commented Oct 25, 2013

The method customization sugar via the do block has a bug in it, not going to release until I have that resolved. For now you can just inherit from the class created by values.

Thx for the answer, its not perfect but works.

What bug is that? Maybe someone can contribute if they know what to fix?

dreamr commented Mar 28, 2014

This is what you get when you use the rubygems version...

Rank = Value.new(:rank, :value) do
  def rank_method
    "ok"
  end
end

r = Rank.new(:ace, 11)
r.rank_method
# => undefined method `rank_method'

This is what you get when you use the github version

Rank = Value.new(:rank, :value) do
  def rank_method
    "ok"
  end
end

r = Rank.new(:ace, 11)
r.rank_method
# => "ok"

Just an FYI for anyone using this. As @tcrayford says, you can use the class version instead of the block version.

The Block version of Struct (which Value is an immutable replacement for) does not add extra methods from Struct onto your object, whereas the Class inheritance version does get these extra methods from Struct.

I would imagine that this is the discrepancy on the block form vs the class inheritance form of Value.

I might look further into this.

Contributor

wojtekmach commented Mar 29, 2015

@tcrayford this issue can be closed since there were a few releases already.

@tcrayford tcrayford closed this Mar 30, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment