Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Lipa - DSL for description treelike structures in Ruby
Ruby

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib
spec
.gitignore
.rspec
Gemfile
MIT-LICENSE
NEWS.md
README.md
Rakefile
lipa.gemspec

README.md

Lipa - DSL for description treelike structures in Ruby

Features

  • Dynamic creating treelike structures for Ruby
  • Flexible syntax
  • Supporting templates and scope initialization
  • Supporting Proc object as attributes

Installation

gem install lipa

Example

require 'lipa'

tree = Lipa::Tree.new :tree do 
  kind :red_leaf do 
    color "red"
  end

  branch :branch do 
    bunch :color => "green",  do 
      leaf :leaf_green
      leaf :leaf_yelow, :color => "yelow"
    end    
  end

  leaf :red_leaf, :kind => :red_leaf
end


puts tree["branch/leaf_green"].color
puts tree["branch/leaf_yelow"].color
puts tree["red_leaf"].color
Something went wrong with that request. Please try again.