0.01
No commit activity in last 3 years
No release in over 3 years
block-to-array converter
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

block-is-array

Build Status License

Block is Array

Installation

$ gem install block-is-array

Usage

Code:

require 'block-is-array'

array = block_is_array do
  user :www

  http do
    server do
      listen 80
      server_name 'foo.com'
    end

    server do
      listen 443, :ssl
      server_name 'bar.com'
    end
  end
end

p array

Output:

[[:user, :www], [:http, [[:server, [[:listen, 80], [:server_name, "foo.com"]]], [:server, [[:listen, 443, :ssl], [:server_name, "bar.com"]]]]]]

For more examples, see examples directory.

License

The Unlicense