Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b45c7545f1
Fetching contributors…

Cannot retrieve contributors at this time

20 lines (16 sloc) 0.493 kb
class FruityPebbles
# You can also indlue Serialization if you want your own format
include ActiveModel::Serializers::JSON
include ActiveModel::Serializers::Xml
attr_accessor :name
def attributes
@attributes ||= {'name' => 'nil'}
end
end
if __FILE__ == $0
cereal = FruityPebbles.new
puts cereal.serializable_hash # => {"name"=>nil}
puts cereal.as_json # => {"name"=>nil}
puts cereal.to_json # => "{\"name\":null}"
puts cereal.to_xml
end
Jump to Line
Something went wrong with that request. Please try again.