0.0
No commit activity in last 3 years
No release in over 3 years
This gem is a framework for implementing Restful Objects servers.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
= 3.4.0
= 0.6.2
= 10.1.1
= 2.14.1

Runtime

= 1.4.4
 Project Readme

ProjectLogo

What's it about?

It's a framework for developing servers that adhere to the Restful Objects specification. It's main purpose is to be completely transparent to the developer and let him focus mainly on the Domain Model that implements the business logic, thereby abstracting him from the API & HTTP issues of exposing the Restful resources.

So it's like plain old ruby objects, with HTTP Restful steroids for free!

How it looks like?

require 'restful_objects'

class Node
  include RestfulObjects::Object

  property   :label, :string
  property   :visited, :bool
  collection :dendencies, Node
end

class Graph
  include RestfulObjects::Object

  collection :nodes, Nodo
  action :topological_sort, return_value: { list: Nodo }

  def topological_sort
    list = []
    nodex.each { |node| node.visited = false }
    unvisited_nodes = nodes
    while not unvisited_nodes.empty? do
      visit(unvisited_nodes.pop, list)
    end
    list
  end

  private

  def visit(node, list)
    if !node.visited
      node.dependencies.each { |dependent_node| visit(dependent_node, list) }
      node.visited = true
      list << node
    end
  end
end

Examples

How to install it?

If you have a Ruby environment (> 1.9.3) with RubyGems installed, simply run:

gem install restful_objects

or add,

gem 'restful_objects'

to your's project Gemfile and 'bundle install' it.

If not, consider using Vagrant to setup a VM with all the dependencies and the latest version of the framework following the instructions here:

https://github.com/vizcay/restful_objects_vagrant

Project Status

The source quality is at alpha state, and it was created mostly as a proof of concept. Still is has plenty of specs and a big percentage of the specification implemented, the grey areas are mostly related to errors and validations. It has been developed with MRI and hasn't been tested on other Ruby implementations.

Dependencies

Resources

License

MIT License.

Credits

This project has been developed as the main subject of Pablo Vizcay undergradute System's Engineering thesis, directed by Dr. Alejandro Zunino for the U.N.I.C.E.N. University in Tandil - Buenos Aires - Argentina.

UnicenLogo