Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

arunthampi-supermodel

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arunthampi-supermodel

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

SuperModel aims to give sexy semantics to any model/library in Ruby that you might create. This includes has, has_many and has_one semantics which we generally associate with ActiveRecord.

This project draws its roots from the ActiveCouch project (http://www.github.com/arunthampi/activecouch), after which I saw myself re-using the same semantics in many other projects.

Hence, the SuperModel project was born!

The irony is that even though a SuperModel will be more bloated than a regular Ruby model, it will be better looking.

So with SuperModel, you can define a model such as this:

class Person < SuperModel::Base has :name, :which_is => :text, :with_default_value => "McLovin" end

Also supports JSON serialization, so you can do this:

p = Person.new(:name => 'McLovin').to_json # => {"name":"McLovin"}

Plans For Future

  1. Serialization in any format: to_xml, to_yaml methods (and of course from_xml, from_yaml methods as well)
  2. Callbacks: Define any callback for any event (This is stolen from ActiveRecord)
  3. More Sexiness and Awesomeness

FAQs

Package last updated on 11 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc