# ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/inflection-1.0.0/lib/inflection.rb:212:in `dup': can't dup Symbol (TypeError)
from /home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/inflection-1.0.0/lib/inflection.rb:212:in `plural'
from /home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/yaks-0.12.0/lib/yaks/format/json_api.rb:39:in `serialize_resource'
from /home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/yaks-0.12.0/lib/yaks/format/json_api.rb:16:in `call'
from /home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/yaks-0.12.0/lib/yaks/pipeline.rb:6:in `block in call'
from /home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/yaks-0.12.0/lib/yaks/pipeline.rb:6:in `each'
from /home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/yaks-0.12.0/lib/yaks/pipeline.rb:6:in `inject'
from /home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/yaks-0.12.0/lib/yaks/pipeline.rb:6:in `call'
from /home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/yaks-0.12.0/lib/yaks/runner.rb:13:in `call'
from /home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/yaks-0.12.0/lib/yaks/config.rb:87:in `call'
from broken_type.rb:17:in `<main>'
Using a string for the type value works. Not sure if docs or code are wrong. I imagine supporting symbols is preferable. 😀
The JSON API example in the README shows the following:
But using a symbol results in an exception:
broken_type.rb
Using a string for the
type
value works. Not sure if docs or code are wrong. I imagine supporting symbols is preferable. 😀