0.0
No commit activity in last 3 years
No release in over 3 years
Serialisable provides a simple DSL for turning xml into ruby objects.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 5.2
~> 1.0

Runtime

~> 1.6
 Project Readme

Serialisable

Simple xml to object deserialisation for Ruby, built on top of Nokogiri (at the moment).

This is still in the hacky stage, so you probably shouldn't use it...

<?xml version="1.0" encoding="utf-8"?>
<plays>
  <play>
    <track>505</track>
    <artist>Arctic Monkeys</artist>
    <time>2013-10-12T15:34:50Z</time>
  </play>
  <play>
    <track>Windowlicker</track>
    <artist>Aphex Twin</artist>
    <time>2013-10-12T15:37:43Z</time>
  </play>
</plays>
require 'serialisable'
require 'time'

class Play
  extend Serialisable

  root 'play'
  element :track, 'track'
  element :artist, 'artist'
  element :time, 'time', Time   # an object responding to #parse
end

class Plays
  extend Serialisable

  root 'plays'
  elements :plays, Play         # a Serialisable object
end

plays = Plays.deserialise(File.read('plays.xml')).plays