solnic / virtus

[DISCONTINUED ] Attributes on Steroids for Plain Old Ruby Objects
MIT License
3.77k stars 228 forks source link

amending 1 documentation comment #285

Closed nunommc closed 8 years ago

nunommc commented 9 years ago

I was hoping that accept_options could work with a Virtus.value_object, but it seems to be accepted only by Virtus::Attribute isn't it? I tried to mixed them together and had an error like

ArgumentError: wrong number of arguments (2 for 0..1)
from ~/.rvm/gems/ruby-2.1.2@hsa/gems/virtus-1.0.3/lib/virtus/instance_methods.rb:16:in `initialize'

Not related with this PR The following example doesn't work:

class NoisyString < Virtus::Attribute
  def coerce(value)
    coercer[value.class].to_string.upcase
  end
end
coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.14%) when pulling c42bcbfc271a2e17f9b655d9f726bea14667ee81 on nunommc:master into 51312f59dd0ba2e2f2678157055497142da308f9 on solnic:master.

booch commented 8 years ago

@nunommc If you're still interested in getting accept_options to work with a Virtus.value_object, could you file a separate issue, with an example of what you're expecting?