Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A DSL for dynamically creating classes and their objects
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
.rspec
Gemfile
LICENSE.txt
README.md
Rakefile
klassy.gemspec

README.md

Klassy

A gem that provides a DSL for dynamically creating classes and their objects.

Why?

The long term goal is to be able to use this gem to facilitate rapid development of other code/gems that communicate with APIs (e.g. eBay, PayPal, etc)

Warning

This code is still in its infancy, and is under active development. It is not to be trusted for anything important.

Installation

Add this line to your application's Gemfile:

gem 'klassy'

And then execute:

$ bundle

Or install it yourself as:

$ gem install klassy

Usage

Example:

Klassy.klassify do
  first_class(name: "bob") do
    second_class(color: "green", answer: 42) do
      third_class
    end
  end
end

results in:

    #<Klassy::FirstClass:97e5b8 @name="bob", @second_class=[
      #<Klassy::SecondClass:96bd50 @color="green", @answer=42, @third_class=[
        #<Klassy::ThirdClass:9690f0>
      ]>
    ]>

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Something went wrong with that request. Please try again.