Skip to content

Instantly share code, notes, and snippets.

@divoxx
Created November 28, 2011 18:36
Show Gist options
  • Select an option

  • Save divoxx/1401449 to your computer and use it in GitHub Desktop.

Select an option

Save divoxx/1401449 to your computer and use it in GitHub Desktop.
require 'roar'
require 'roar/representer/json'
class Article
include Roar::Representer::JSON
property :title
property :id
end
puts Article.new(title: "Foo", id: 123).to_json
roar_test.rb:11:in `initialize': wrong number of arguments(1 for 0) (ArgumentError)
from roar_test.rb:11:in `new'
from roar_test.rb:11:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment